SebastianM6L,
@SebastianM6L@mastodon.social avatar

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

ghickman,
@ghickman@mastodon.social avatar

@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,
@SebastianM6L@mastodon.social avatar

@ghickman many thanks. Already figured that out.

ghickman,
@ghickman@mastodon.social avatar

@SebastianM6L brilliant! May your tests run fast, and consistently then :)

Lleites,
@Lleites@fosstodon.org avatar

@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,
@SebastianM6L@mastodon.social avatar

@Lleites Thanks. Meanwhile I also realized that.
Have configured the names now in the config.

adamchainz,
@adamchainz@fosstodon.org avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • django
  • Durango
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • osvaldo12
  • khanakhh
  • Youngstown
  • mdbf
  • slotface
  • rosin
  • everett
  • ngwrru68w68
  • kavyap
  • InstantRegret
  • JUstTest
  • GTA5RPClips
  • cubers
  • ethstaker
  • normalnudes
  • tacticalgear
  • cisconetworking
  • tester
  • Leos
  • modclub
  • megavids
  • provamag3
  • anitta
  • lostlight
  • All magazines