How to verify mocked python class method is called with argument in unit test
I have a class TestClass in file file2.py
Usual pytest workflow – can’t run tests in a file
I’m trying to setup a project (Python 3.4.4, pytest 3.3.1) to use pytest, but pytest is failing to run tests in a file or a directory. I think I’m using pytest wrong, but am not what the correct workflow would be.
Usual pytest workflow – can’t run tests in a file
I’m trying to setup a project (Python 3.4.4, pytest 3.3.1) to use pytest, but pytest is failing to run tests in a file or a directory. I think I’m using pytest wrong, but am not what the correct workflow would be.
Usual pytest workflow – can’t run tests in a file
I’m trying to setup a project (Python 3.4.4, pytest 3.3.1) to use pytest, but pytest is failing to run tests in a file or a directory. I think I’m using pytest wrong, but am not what the correct workflow would be.
Usual pytest workflow – can’t run tests in a file
I’m trying to setup a project (Python 3.4.4, pytest 3.3.1) to use pytest, but pytest is failing to run tests in a file or a directory. I think I’m using pytest wrong, but am not what the correct workflow would be.
Usual pytest workflow – can’t run tests in a file
I’m trying to setup a project (Python 3.4.4, pytest 3.3.1) to use pytest, but pytest is failing to run tests in a file or a directory. I think I’m using pytest wrong, but am not what the correct workflow would be.
Pass a list of parameter to parametrize from a function
I have session scope fixture for initiating db connection
Pass a list of parameter to parametrize from a function
I have session scope fixture for initiating db connection
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?