SebastianM6L, 1 month ago Any #django cracks here who can explain me why when I run my tests with the django built in manage.py test (runs unittest) I have 51 tests run. When I run them with pytest It will only run 38 tests. #python #pytest
Any #django cracks here who can explain me why when I run my tests with the django built in manage.py test (runs unittest) I have 51 tests run.
manage.py test
When I run them with pytest It will only run 38 tests.
pytest
#python #pytest
ghickman, 1 month ago @SebastianM6L You'll need your test modules to be named test_*.py, and for packages to have a init.py so pytest will consider them. Good luck!
@SebastianM6L You'll need your test modules to be named test_*.py, and for packages to have a init.py so pytest will consider them. Good luck!
SebastianM6L, 1 month ago @ghickman many thanks. Already figured that out.
@ghickman many thanks. Already figured that out.
ghickman, 1 month ago @SebastianM6L brilliant! May your tests run fast, and consistently then :)
@SebastianM6L brilliant! May your tests run fast, and consistently then :)
Lleites, 1 month ago @SebastianM6L check the filenames of the test that are not running. Pytests only scans files that start with test_, you can also configure that https://docs.pytest.org/en/7.1.x/example/pythoncollection.html#changing-naming-conventions
@SebastianM6L check the filenames of the test that are not running. Pytests only scans files that start with test_, you can also configure that https://docs.pytest.org/en/7.1.x/example/pythoncollection.html#changing-naming-conventions
test_
SebastianM6L, 1 month ago @Lleites Thanks. Meanwhile I also realized that. Have configured the names now in the config.
@Lleites Thanks. Meanwhile I also realized that. Have configured the names now in the config.
adamchainz, 1 month ago @SebastianM6L @Lleites See also https://pytest-django.readthedocs.io/en/latest/faq.html#faq-tests-not-being-picked-up
@SebastianM6L @Lleites See also https://pytest-django.readthedocs.io/en/latest/faq.html#faq-tests-not-being-picked-up
Add comment