Closed aryaniyaps closed 1 year ago
Hi,
Thanks for reporting, do you have some reference about __test__ = False
from pytest?
Hi,
Thanks for reporting, do you have some reference about
__test__ = False
from pytest?
yes, its a part of the nose idioms that pytest supports. https://docs.pytest.org/en/stable/how-to/nose.html#supported-nose-idioms
Thanks!
Let us consider we have a test case like the following:
Notice that we are type hinting the
test_get_books
function. Because of this (and the fact that this test function lies in another file), pytest attempts to collect tests from TestClient (as the class name starts with "Test").error traceback:
This is a known issue, and can be fixed by setting:
This is being done already by other frameworks such as starlette: https://github.com/encode/starlette/blob/master/starlette/testclient.py#L363
I think that the TestClient class must be updated to provide similar behavior.