I have a Django 4.0.6 project, Python 3.9.15, Ubuntu 22.10, pipenv 2022.10.25, pytest 7.1.2
The test output was cached somewhere and now any modification is ignored unless I delete the method.
The steps I performed:
pipenv run pytest src/some/path/models.py
Removing the method solves the problem, but any modification made to the method source makes it appear again in traceback, UNMODIFIED.
Does pipenv/pytest/whatever cache the source somewhere?
pipenv run pytest src/some/path/models.py --cache-clear did not help.
As well as removing the .pytest_cache/.
I tried removing the venv/some/path/__pycache__/models.cpython-39.pyc file (and all compiled *.pyc files in venv)
But nothing seem to help. The same traceback appears every time I run tests.
Had the same issue and figured it out - the pytest i was running via pipenv run pytest ... was not actually part of the venv. I recommend you run it as pipenv run python -m pytest ...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With