Snippets used while developing new features #83
ngraymon
started this conversation in
Code snippets
Replies: 2 comments
-
Need to use |
Beta Was this translation helpful? Give feedback.
0 replies
-
Good reference |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
You can always just generate files for testing from
driver.py
:to generate the current Z2 residual equations:
and Z3
Alternatively the
blanket.py
tests are a quick easy way to generate the full files:/termfactory/test/blanket/
then to generate all of them
pytest blanket_test.py -sx -vv
or to run only a specific class of tests:
pytest blanket_test.py -k 'Test_code_fcc' -sx -vv
used while working on Implement
opt_einsum
generator for full cc #76pytest blanket_test.py -k 'Test_code_dt_equations' -sx -vv
used while working on Fix
opt_einsum
paths for dt_equations #75To manually check the coverage report use the deep tests:
/termfactory/tests/
Run all the deep tests
python3 -m coverage run -m pytest -k 'deep' -sx -vv
or, better yet run only the tests you need
python3 -m coverage run -m pytest deep/ -k 'Test_write_cc_optimized_paths_from_list' -sx -vv
Say we want to specifically look at the blanket coverage:
python3 -m coverage run -m pytest blanket_test.py -sx -vv
Then once that's done we can generate the report
python3 -m coverage report
We can also find what lines we need to correct with
python3 -m coverage report -m
Or if I want to check coverage on just the
code_full_cc.py
while I'm making changes:python3 -m coverage report -m ./../../termfactory/code_full_cc.py
:See https://coverage.readthedocs.io/en/latest/cmd.html#cmd-report for more options
Beta Was this translation helpful? Give feedback.
All reactions