Replies: 2 comments 1 reply
-
You can prevent pytest from discovering such functions by setting a boolean test_var = lambda: None
test_var.__test__ = False |
Beta Was this translation helpful? Give feedback.
0 replies
-
def check(a,b):
assert a == b
test_var = lambda : check(1,2) Although it cannot use Since Python can treat lambda as a function, pytest does not need to treat it differently. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi there! Let's say i want to define a variable:
Pytest recognizes this as a valid test case (instance of class
Function
). I understand why, but is it really the correct behavior? I cannot use any assertions here anyway, so why this has to be a valid test case?Beta Was this translation helpful? Give feedback.
All reactions