assertion testing
#13389
Replies: 1 comment 6 replies
-
Right now python as a language doesn't support that |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello!
I had a request on my work to measure assertion coverage.
is there such plugin for pytest?
i understand that theoretically it is possible through ast parsing, but it might quickly become complex.
please share your approaches to such a task.
here's my dream:
in module X:
1 y=dict(a=1)
in tests:
1 def test():
2 assert 'a' in X.y
in coverage report:
module X line 1 is fully assertion-covered in module tests line 2
here's small snippet example with parsing ast:
input:
output:
full code:
Beta Was this translation helpful? Give feedback.
All reactions