This repository has been archived by the owner on Sep 13, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This PR makes an overhaul to the nuances of our PyTest framework. * In order to ship around the testing configuration (the contents of `conftest.py`), this PR ports all of those features to the `testing.py` file which is now treated as a first class PyTest Plugin. * The `pytest11` entry point for the `testing.py` file has been added to the `setup.py` file so it will be detected automatically by any installed PyTest, allowing transferring of the `--runslow` and `--runexamples` CLI flags into PyTest on its own. * This also enables the ability to access these flags anywhere * Due to the removal of the [pytest.config global](https://docs.pytest.org/en/latest/deprecations.html#pytest-config-global) in the Version 5+ of PyTest, I had to rework how some of our `mark` functions behave. Instead of writing our own decorators, I instead am using the PyTest recommended method of `pytest_collection_modifyitems`, an example of which can be found [here](https://docs.pytest.org/en/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option). I have also based this off the implementation this from Dask Distributed dask/distributed#2677. * Due to the previous change, the `mark_slow` and `mark_example` decorators are no more. We now just use `pytest.mark.slow` and `pytest.mark.example` respectively. This change has been propagated through the tests. * I fixed a bug in the `test_visualization` where the `_has_plotly` flag was always being set to `True`. * I have tested this with both PyTest 5 and PyTest 4.6.3 And finally, all of this, was so we could install QCFractal and run `pytest --pyargs qcfractal` from anywhere and still have access to the optional `--runslow` flag (and it solved a PyTest 5 deprecation)
- Loading branch information