Skip to content

Commit

Permalink
Install pandoc version supported by nbconvert on RTD
Browse files Browse the repository at this point in the history
Signed-off-by: Håkon Wiik Ånes <hwaanes@gmail.com>
  • Loading branch information
hakonanes committed Nov 1, 2023
1 parent 542da6c commit aefc94e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 7 deletions.
19 changes: 14 additions & 5 deletions doc/dev/running_writing_tests.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ Install necessary dependencies to run the tests::

pip install --editable .[tests]

Some useful :doc:`fixtures <pytest:explanation/fixtures>`, like a dummy scan and
Some useful :doc:`fixtures <pytest:explanation/fixtures>`, like a dummy EBSD scan and a
corresponding background pattern, are available in the ``conftest.py`` file.

.. note::
Expand All @@ -33,13 +33,22 @@ For an even nicer presentation, you can use ``coverage.py`` directly::
Then, you can open the created ``htmlcov/index.html`` in the browser and inspect the
coverage in more detail.

To run only a specific test function or class, .e.g the ``TestEBSD`` class::
We can run tests in parallel on four CPUs using pytest-xdist::

pytest -n 4

To run only a specific test function or class, e.g. the ``TestEBSD`` class::

pytest -k TestEBSD

This is useful when you only want to run a specific test and not the full test suite,
e.g. when you're creating or updating a test.
But remember to run the full test suite before pushing!
This is useful when we only want to run a specific test and not the full test suite,
e.g. when we're creating or updating a test.
We have to remember to run the full test suite before pushing, though!

We can automatically rerun so-called flaky tests (tests yielding both passing and
failing results without code changes) using the pytest plugin pytest-rerunfailures::

pytest --reruns 2

Docstring examples are tested :doc:`with pytest <pytest:how-to/doctest>` as well.
If you're in the top directory you can run::
Expand Down
5 changes: 5 additions & 0 deletions doc/environment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
channels:
- conda-forge
dependencies:
- python=3.11
- pandoc>=2.14.2, <4.0.0
6 changes: 4 additions & 2 deletions readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,23 @@ sphinx:
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "mambaforge-22.9"
nodejs: "19"
# Some of these packages are needed by PyVista/Trame to render 3D
# plots from RTD's server.
apt_packages:
- imagemagick
- libgl1-mesa-dev
- pandoc
- xvfb

# Build doc in all formats (HTML, PDF and ePub)
formats:
- htmlzip
- pdf

conda:
environment: doc/environment.yml

# Python environment for building the docs
python:
install:
Expand Down

0 comments on commit aefc94e

Please sign in to comment.