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
Use pytest
#48
Use pytest
#48
Conversation
- release.py can now update new `epispot/__init__.py` - Adds classifiers and project URLS to both `setup.py` and `setup-nightly.py` - Removes unnecessary testing suites (`test_cov.py`) - Changes `epispot.__version__` to `epispot.version`, meaning it is now accessible globally and will show up on pdoc - Updates `bin/epispot` to use new `epispot.version` to give version info
Replaces with: ```python except ImportError: # foo ```
Creates README.md to explain testing with `pytest` See `test_x.py` as an example of a properly-configured test.
All `epispot.pre` modules are now compatible with pytest through `tests/pytest/test_sir-variants.py` - SIR - SEIR - SIRD - SIHRD
Tests - Recurrent models - Starting state - Critical compartment - Triage
Tests - Plotting - Fitters (none currently)
Removes - epi.fitters - grad_des - tree_search (experimental) - epi.plots - compare
Changes most foo/* paths to foo/
- Fixes code coverage issue due to warnings being included in code coverage reporting - Changes sanity check to check *only* for missing version and source information
- Changes `setup-nightly` package data
* Removes existing epispot installation in testing workflows Solves installation issue * Bypasses Python `proceed? (y/n)` prompt when uninstalling epispot Fixes error from previous commit * Runs `pytest` as module to import epispot from `Namespace` * Removes epispot from `bin/requirements.txt` Per @Quantalabs request
Codecov Report
@@ Coverage Diff @@
## master #48 +/- ##
==========================================
- Coverage 97.44% 88.42% -9.03%
==========================================
Files 6 7 +1
Lines 470 432 -38
==========================================
- Hits 458 382 -76
- Misses 12 50 +38
Continue to review full report at Codecov.
|
Code coverage failed due to not testing the CLI, which will be fixed in a later PR. For now, code coverage is essentially passing.
|
This pull request introduces 1 alert and fixes 1 when merging 0fc625a into 99e1f24 - view on LGTM.com new alerts:
fixed alerts:
|
We are now ready for review, pinging @Quantalabs |
This is still high priority |
After review, we're splitting up the PR into multiple PRs that will be merged in a certain order specified on this PR and the Management project |
Set up
pytest
as main testing frameworkAfter PR #46, solves issue #47
New Feature
Transforms old tests to use
pytest
as the main testing framework.pytest
allows forassert
-based testing and boundsIt also adds GitHub CODEOWNERS
Known Issues
Fixes #47 "Getting started with pytest"
Code Breakdown
$ python -m pytest
commandexcept
withexcept ImportError
epispot
due topip install -r bin/requirements.txt
command in workflows which installs epispot from PyPI instead of from the sourcehelp()
commands)__
from metadata variable names to make them globally accessible# pragma: no cover
on soon-to-be deprecated functionstests/
directory cleanpytest
__init__.py
Additional Notes
There's a lot going on in this PR and it may need to be broken up into multiple PRs.
For now, it will be created as a draft PR just because of the sheer scale of the PR.
Additionally, before moving into merge stage, all merge conflicts should be resolved and all basic checks (build and code coverage) should pass. After we enter the merge stage, reviewers should analyze code for compatibility issues and other code quality-related alerts will be dealt with if necessary.
Closes #47