You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A recent release included support for alternative (i.e. non-"test") test prefixes.
Pytest, also uses a custom __test__ dunder when discovering tests: python.py#L349. I.e. any function with the attribute __test__ = True is considered a test regardless of its prefix. Currently, this library does not support this dunder.
Here, the function name is looked up in the frame globals, and if found, it checks for the __test__ dunder. I would need to refresh my memory on Python's FrameInfo to check whether this is the best way of doing this.
The text was updated successfully, but these errors were encountered:
A recent release included support for alternative (i.e. non-"test") test prefixes.
Pytest, also uses a custom
__test__
dunder when discovering tests: python.py#L349. I.e. any function with the attribute__test__ = True
is considered a test regardless of its prefix. Currently, this library does not support this dunder.Would it be possible to support the
__test__
dunder in the recently addedis_pytest_test
method?I am happy to work on this unless someone else sees a quick fix.
Suggested Fix
An additional test in the StackFrameNamer class for the
__test__
dunder could be something like the following:Here, the function name is looked up in the frame globals, and if found, it checks for the
__test__
dunder. I would need to refresh my memory on Python'sFrameInfo
to check whether this is the best way of doing this.The text was updated successfully, but these errors were encountered: