Django

Code

Ticket #6168 (closed: fixed)

Opened 1 year ago

Last modified 6 months ago

Cannot run invalid_models tests individually from runtests.py

Reported by: floguy Assigned to: floguy
Milestone: Component: Testing framework
Version: SVN Keywords:
Cc: Triage Stage: Accepted
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 1

Description

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

Attachments

runtests_bug.diff (0.6 kB) - added by floguy on 12/09/07 22:31:47.
runtests_bug.2.diff (0.9 kB) - added by floguy on 03/17/08 11:28:59.
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.

Change History

12/09/07 22:31:47 changed by floguy

  • attachment runtests_bug.diff added.

12/09/07 22:32:01 changed by floguy

  • owner changed from nobody to floguy.
  • needs_better_patch changed.
  • status changed from new to assigned.
  • needs_tests changed.
  • needs_docs changed.

01/18/08 07:06:13 changed by russellm

  • needs_better_patch set to 1.
  • 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)

03/17/08 11:28:59 changed by floguy

  • attachment runtests_bug.2.diff added.

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.

06/06/08 08:02:11 changed by russellm

  • status changed from assigned to closed.
  • resolution set to fixed.

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/Change #6168 (Cannot run invalid_models tests individually from runtests.py)




Change Properties
Action