Opened 4 years ago

Closed 4 years ago

#18670 closed Bug (wontfix)

Tests are loaded from models.py before tests.py, causes false negative

Reported by: Bradley Ayers <bradley.ayers@…> Owned by: nobody
Component: Testing framework Version: master
Severity: Normal Keywords:
Cc: flo@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

I have app/models/foo.py, containing a model with app_label set appropriately. I also have app/tests.py containing a test case called foo. When I run manage.py test app.foo, I am greeted with:

ValueError: Test label 'app.foo' does not refer to a test

Change History (9)

comment:1 Changed 4 years ago by Chris Beaven

Triage Stage: UnreviewedAccepted

comment:2 Changed 4 years ago by Chris Beaven

Needs tests: set
Triage Stage: AcceptedReady for checkin

Code looks good, probably should have tests in django/tests/test_runner

comment:3 Changed 4 years ago by Chris Beaven

Triage Stage: Ready for checkinAccepted

comment:4 Changed 4 years ago by Simon Charette

Where's the code? Missing PR reference?

comment:5 Changed 4 years ago by Bradley Ayers <bradley.ayers@…>

comment:6 Changed 4 years ago by fhahn

Cc: flo@… added
Has patch: set
Needs tests: unset
Version: 1.4master

I've added a test to Bradley's patch and created a new pull request: https://github.com/django/django/pull/849

comment:7 Changed 4 years ago by Aymeric Augustin

Related: #17366

comment:8 Changed 4 years ago by Carl Meyer

This will be rendered irrelevant by #17365, which doesn't load tests from models.py at all, and deprecates the code changed in this patch.

comment:9 Changed 4 years ago by Carl Meyer

Resolution: wontfix
Status: newclosed

Closing wontfix, as the new test runner merged in #17365 does not support tests in models.py, and the old runner is deprecated.

Note: See TracTickets for help on using tickets.
Back to Top