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 test coverage #11

Closed
mattjshannon opened this issue Oct 13, 2018 · 3 comments
Closed

Improve test coverage #11

mattjshannon opened this issue Oct 13, 2018 · 3 comments

Comments

@mattjshannon
Copy link
Contributor

Unit tests need some TLC, particularly the decomposer.py and decomposer_base.py modules.

@PAHdb
Copy link
Owner

PAHdb commented Nov 14, 2018

The coverage report generated by Travis does not only include the coverage of pypahdb, but also of pytest and all its dependencies. Adding --source pypahdb to the coverage command fixes this.
[update] It looks like the coverage is the same, but Travis is quicker in generating the number.

@mattjshannon
Copy link
Contributor Author

Apparently we can consolidate our fixtures and place them in conftest.py, which will make them available (automatically) to all of the test_*.py files. Neat!

Refs:
https://stackoverflow.com/questions/34466027/in-py-test-what-is-the-use-of-conftest-py-files
https://docs.pytest.org/en/latest/fixture.html#conftest-py-sharing-fixture-functions

@PAHdb
Copy link
Owner

PAHdb commented Nov 14, 2018

Currently the tests are making use of unittests, which does not work well with pytests' fixtures. Since unittests uses classes, commonality between tests can be captured in class properties.

Test coverage is now above 80%, which should be sufficient for know.

@PAHdb PAHdb closed this as completed Nov 14, 2018
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

No branches or pull requests

2 participants