If I define a pytest test like so:
from my_app.main import some_function
def test_example():
breakpoint()
foo = 'bar'
some_function()
Then pdf will stop at the beginning of some_function instead of at foo = 'bar'. How can I get it to stop inside the test code?
Here is how I am running pytest:
pytest /app/tests/test_example.py::test_example --cov=/app/src/
Apparently, some PyTest plugins can interfere with pdb. Removing the
--covflag fixed the issue and I am now able to stop on breakpoints inside tests.