Code

Opened 6 years ago

Closed 6 years ago

#6168 closed (fixed)

Cannot run invalid_models tests individually from runtests.py

Reported by: floguy Owned by: floguy
Component: Testing framework Version: master
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: UI/UX:

Description

There is a small bug in runtests.py which prevents the invalid_models test individually from runtests.py.

Attachments (2)

runtests_bug.diff (569 bytes) - added by floguy 6 years ago.
runtests_bug.2.diff (903 bytes) - added by floguy 6 years ago.
Fixed the real problem. The tests were getting added just fine, but "test_labels" was still getting passed in along with the other apps. When the test runner attempted to import the "invalid_models" app, then everything crashed and burned. Simply removing that entry from test_labels keeps all other functionality intact while fixing the problem at hand.

Download all attachments as: .zip

Change History (5)

Changed 6 years ago by floguy

comment:1 Changed 6 years ago by floguy

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to floguy
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 6 years ago by russellm

  • Patch needs improvement set
  • Triage Stage changed from Unreviewed to Accepted

The problem definitely exists, but the solution isn't as simple as described. test_models is detritus of some kind; it's an empty list, and is never changed. The patch provided changes the way other tests can be invoked. Here's the validation cases:

./runtests --settings=XXX
should run the full suite (seems to be correct with patch)

./runtests --settings=XXX test_client_regress
should run 15 tests (with patch, runs 19)

./runtests --settings=XXX test_client_regress.AssertContainsTests
should run 1 test (with patch, runs 19)

Changed 6 years ago by floguy

Fixed the real problem. The tests were getting added just fine, but "test_labels" was still getting passed in along with the other apps. When the test runner attempted to import the "invalid_models" app, then everything crashed and burned. Simply removing that entry from test_labels keeps all other functionality intact while fixing the problem at hand.

comment:3 Changed 6 years ago by russellm

  • Resolution set to fixed
  • Status changed from assigned to closed

In [7576]: Fixed #6168 -- Updated the Django system test runner to make it possible to run the invalid_models test (and any other invalid_ test) explicitly, rather than just as part of the full suite. Thanks for tracking down the problem, Eric Florenzano.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.