Documents & Tests
This page describes solutions ice-learn adopts about documentation generation, unit tests and documentation-based test. Note that following commands should be executed in a poetry shell
, or prepended by poetry run
.
pytest
- We use
pytest
for unittesting. For example,
where -s
will print outputs for failed tests.
- Run specific tests with
test_mod.py::TestClass:test_method
ortest_mod.py::test_function
.
- Option
-m slow
will run tests decorated with the@pytest.mark.slow
decorator.
- Option
-m "not slow"
will run tests not decorated with the@pytest.mark.slow
decorator.
-
See more configurations in
pytest.ini
. -
ice.llutil.test
has some extensions for conditional tests for conveniency.
xdoctest
We use xdoctest
for testing demostration code in docstring. For example,
or
lazydocs
We generate markdown documentations from docstring using a modified lazydocs
script. For example,
mkdocs
We generate the documents site from manually written as well as autogenerated markdown using mkdocs
, the plugin mkdocs-awesome-pages
and the theme mkdocs-material
. In the ./docs
directory, files in documents
are automatically generated by lazydocs
, while other subfolders contain manually written docs.
Configuration file is mkdocs.yml
. Changing the navigator appearance of the document site requires modifying .pages
file in each level of subdirectories.
Run following command locally to preview the site at the root directory of ice-learn
project:
Run following command to push documents to gh-pages
branch (for Github Pages).
See this page for more infomation on deploying documents.