Skip to content

Commit

Permalink
resolves #242
Browse files Browse the repository at this point in the history
move the pytest hardcoded options from pyproject.toml to noxfile.py

adds a tests/README.rst to document the dev workflow for unit testing.

fix typo in index.rst
  • Loading branch information
2bndy5 committed Apr 27, 2023
1 parent 8371004 commit e389078
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 3 deletions.
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This theme is an adaptation of the popular `mkdocs-material
This theme is regularly maintained to stay up to date with the upstream
`mkdocs-material <https://squidfunk.github.io/mkdocs-material/>`__ repository.
The HTML templates, JavaScript, and styles from the `mkdocs-material
<https://squidfunk.github.io/mkdocs-material/>`__ theme are incoroprated directly
<https://squidfunk.github.io/mkdocs-material/>`__ theme are incorporated directly
with mostly minor modifications.

Independent of the upstream mkdocs-material theme, this theme integrates with
Expand Down
2 changes: 1 addition & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def tests(session: nox.Session, sphinx: str):
session.run("npm", "run", "build", external=True)
session.install(f"sphinx{sphinx}")
session.install("-r", "tests/requirements.txt")
session.run("coverage", "run", "-m", "pytest")
session.run("coverage", "run", "-m", "pytest", "-vv", "-s")
# session.notify("docs") <- only calls docs(html), not dirhtml or latex builders


Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ extend-exclude = '^/docs/tensorstore_demo/__init__\.py$'

[tool.pytest.ini_options]
minversion = "6.0"
addopts = "-vv -s"
testpaths = ["tests"]

[tool.coverage.run]
Expand Down
38 changes: 38 additions & 0 deletions tests/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
Unit tests
==========

To run unit tests for the sphinx-immaterial theme, there must first be dependencies installed.
Install the dependencies by executing the following from the repo root folder:

.. code-block:: shell
pip install -r tests/requirements.txt
You should now be ready to run the unit tests. This can be done directly with pytest CLI:

.. code-block:: shell
pytest -vv -s
Using ``nox``
-------------

This repo is setup to use `nox <https://nox.thea.codes/en/stable/>`_ in a Continuous Integration
workflow. The above instructions can be executed with 1 ``nox`` command.

.. code-block:: shell
nox -s tests
Code Coverage
-------------

Code coverage is included when using `nox <https://nox.thea.codes/en/stable/>`_ as well.
The coverage report should be generated *after* running the tests with ``nox``.

.. code-block:: shell
nox -s coverage
This will generate a ``.coverage_.md`` file of the coverage summary and a more in-depth analysis
in HTML form located in ``htmlcov`` folder at the repo's root.

0 comments on commit e389078

Please sign in to comment.