Is there a way to require Pytest to reload imports in a test file?
TL;DR: I would like Pytest to reload imports in certain files when it runs those tests. Some of the imports in my code base have side effects that I need to control at test time. The behavior would basically be like importlib.reload
for any module in the test file. Is this possible?
Mocking a nested function call with pytest
If I have a function, A1, that is being tested, and that function imports and calls function B1, which itself calls B2 from the same file, how do I mock function B2?
How can I change the color of the file name and line number in pytest output?
How can I change the color of the file name and line number in pytest output?
Pytest is testing more than just the test_*.py files
Pytest is apparently running tests against my entire modules, and not just the specific functionality in my test_*.py
files.
Pytest can’t find imports from tested modules
I am trying to test a package with the following structure:
Pytest can’t find imports from tested modules
I am trying to test a package with the following structure:
Pytest can’t find imports from tested modules
I am trying to test a package with the following structure:
Pytest can’t find imports from tested modules
I am trying to test a package with the following structure:
Pytest can’t find imports from tested modules
I am trying to test a package with the following structure: