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

Simple python-based script to run unit tests #580

Merged
merged 14 commits into from
Mar 18, 2020

Conversation

jllanfranchi
Copy link
Contributor

@jllanfranchi jllanfranchi commented Mar 17, 2020

Search through PISA codebase (from PISA/pisa/ dir) looking for *.py filenames. Within each *.py file, find functions defined by def test_*.

  • Import each module quietly. If failure, re-import with trace-level output then print the original exception
  • Run each test_* function. If there is an exception, re-run with trace-level verbosity. Also print the traceback.
  • Print summary of numbers of modules loaded successfully / unsuccessfully and tests run successfully / unsuccessfully at the end
  • Raise an exception / fail in the end of the script if any module failed to import or any test function raised an exception

Note that this takes ~1:20 to run on my PC (albeit there are no test pipelines being run and no hypo testing is being run)

@jllanfranchi jllanfranchi merged commit 094d902 into icecube:master Mar 18, 2020
@jllanfranchi jllanfranchi deleted the pytest branch March 24, 2020 17:01
@thehrh thehrh mentioned this pull request Aug 8, 2024
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.

1 participant