Pytest enhancements
Compare changes
- Kevin Kuns authored
+ 88
− 0
@@ -40,6 +40,14 @@ def pytest_addoption(parser):
@@ -270,3 +278,83 @@ def relfile_test(_file_, request, pre = None, post = None, fname = None):
Maintenance will be performed on git.ligo.org, containers.ligo.org, and docs.ligo.org on Tuesday 1 April 2025 starting at approximately 9am PDT. It is expected to take around 30 minutes and there will be several periods of downtime throughout the maintenance. Please address any comments, concerns, or questions to the helpdesk.
Adds
generate
that marks a test as generating test data. These tests will only be run when the --generate
flag is given, and all other tests won't be run in this case. This prevents accidentally overwriting test data.compare_noise
which checks whether all noises in a budget are the same as in another budget. A list of noises passing, failing, or skipped is printed and an assertion error is raised if any traces are different.The unit tests test_save_budgets
and test_check_noise
are added to test/budgets/test_budgets.py
making use of the new fixture and marker. The compare_noise
fixture is useful because it quickly checks if noises are the same and fails if any are different. So you can have pytest both continuously plotting a budget and quickly checking if any noises have changed by doing for example
ptw -- test/budgets/test_budgets.py -s -k test_check_noise
ptw -- test/budgets/test_budgets.py -s -k test_load[Aplus]