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

Improve testing #37

Merged
merged 6 commits into from Jan 4, 2022
Merged

Conversation

cthoyt
Copy link
Contributor

@cthoyt cthoyt commented Jan 4, 2022

Summary

This PR improves the documentation of installation, testing, and makes the unit tests less rigid to future improvements

  • Code passes all tests
  • Unit tests provided for these changes
  • Documentation and docstrings added for these changes

Changes

  • Since all commands from python setup.py have been deprecated, it doesn't make sense to use python setup.py test anymore. This is the only place (AFAIK) where tests_require is used. As an alternative, this can be installed as an extra (as is already in the GitHub Actions workflow) with pip install .[test] (20cf0f9)
  • Modernize installation instructions from deprecated python setup.py install to pip install . (dfff1af)
  • Fix typos in README (6b1abb5)
  • Update local testing instructions to use tox because it's more simple and takes care of all installation of package and testing requirements (as solved in previous bullet point) (4f0815a)
  • Remove hard-coded counts in metric tests, which makes it possible to arbitrarily extend the metric set definitions without needing to change the test code (d16e7dd)

`unittest` is a builtin, and as of py36, so is mock.
Since all commands from `python setup.py` have been deprecated, it doesn't make sense to use `python setup.py test` anymore. This is the only place (AFAIK) where `tests_require` is used. As an alternative, this can be installed as an extra (as is already in the GitHub Actions workflow) with `pip install .[test]
Tox is much more reproducible for tests as it also handles installing all package and testing requirements
Un-hardcoding these numbers makes it possible to arbitrarily extend the metric set definitions without needing to change the test code
@codecov-commenter
Copy link

Codecov Report

Merging #37 (d16e7dd) into main (f53f77f) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main      #37   +/-   ##
=======================================
  Coverage   99.77%   99.77%           
=======================================
  Files          16       16           
  Lines         874      874           
=======================================
  Hits          872      872           
  Misses          2        2           
Impacted Files Coverage Δ
tests/integration/test_aggregation.py 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f53f77f...d16e7dd. Read the comment docs.

@benedekrozemberczki benedekrozemberczki merged commit 9ba200a into AstraZeneca:main Jan 4, 2022
@cthoyt cthoyt deleted the improve-testing branch January 4, 2022 21:28
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.

None yet

3 participants