Closed devdanzin closed 1 year ago
Patch coverage: 100.00%
and no project coverage change.
Comparison is base (
d0ad384
) 95.76% compared to head (1a55a05
) 95.76%.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Please rename the files, they don't need to be called x_unit.py
they're already in a unit
folder
Thanks for reviewing this!
Unfortunately, when I renamed the files to avoid using "_unit", pytest threw errors like:
______________________________________ ERROR collecting test/unit/test_graph.py _______________________________________
import file mismatch:
imported module 'test_graph' has this __file__ attribute:
wily\test\integration\test_graph.py
which is not the same as the test file we want to collect:
wily\test\unit\test_graph.py
HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
Not sure whether it comes from pytest or the coverage plugin. I guess that's why we already had a build_unit.py file under test/unit, to avoid this kind of error. So I'm reverting the rename unless you'd prefer that I try to figure out how to support files with the same basenames.
I've addressed your comments, let me know if any of the solutions needs improvement.
Thanks for reviewing this!
Unfortunately, when I renamed the files to avoid using "_unit", pytest threw errors like:
______________________________________ ERROR collecting test/unit/test_graph.py _______________________________________ import file mismatch: imported module 'test_graph' has this __file__ attribute: wily\test\integration\test_graph.py which is not the same as the test file we want to collect: wily\test\unit\test_graph.py HINT: remove __pycache__ / .pyc files and/or use a unique basename for your test file modules
Not sure whether it comes from pytest or the coverage plugin. I guess that's why we already had a build_unit.py file under test/unit, to avoid this kind of error. So I'm reverting the rename unless you'd prefer that I try to figure out how to support files with the same basenames.
I've addressed your comments, let me know if any of the solutions needs improvement.
ah yes, I forgot about that. Pytest requires that all files have unique names
This PR adds unit tests for index, report, rank, graph and list-metrics. It should help land the JSON output PR (and any others touching output) without any regressions.
It's a bit rough in the edges, but I believe these are good to have. Instead of testing the output it would be possible to mock tabulate, but I feel checking the output works best.