Skip to content
Snippets Groups Projects

Pytest enhancements

Merged Kevin Kuns requested to merge kevin.kuns/pygwinc:pytest-enhancements into master

Adds

  1. A pytest marker 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.
  2. A pytest fixture 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]

Merge request reports

Merge request pipeline #376201 passed

Merge request pipeline passed for 8486429d

Approval is optional

Merged by Christopher WipfChristopher Wipf 2 years ago (Jul 7, 2022 12:34am UTC)

Merge details

  • Changes merged into with 64da7e19.
  • Did not delete the source branch.

Pipeline #422027 passed

Pipeline passed for 64da7e19 on master

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
Please register or sign in to reply
Loading