Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow running unit tests with pytest #1292

Merged
merged 3 commits into from
Nov 8, 2023

Conversation

ZedThree
Copy link
Contributor

@ZedThree ZedThree commented Nov 6, 2023

Some small changes to enable running the unit tests with either unittest or pytest

  • use the unittest.skipIf decorator to skip tests, instead of removing them manually in run_all.py
  • for the bundled test files, make sure the name is relative to the test directory
  • rename the files to test_*.py

All of these mean running just pytest from the top level works, without breaking the existing testing workflow.

@ZedThree ZedThree force-pushed the unit-test-work-with-pytest branch from ace7eab to 66cde64 Compare November 6, 2023 13:40
@ZedThree
Copy link
Contributor Author

ZedThree commented Nov 6, 2023

This could go even further, of course, and rewrite everything the tests for pytest. Pytest doesn't need classes, it just looks for functions called test_*, and has some useful built-in fixtures.

@jswhit jswhit merged commit f9dc8b2 into Unidata:master Nov 8, 2023
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants