Opened 5 years ago

Closed 4 years ago

#15919 closed Bug (worksforme)

Test failure on specific label

Reported by: BerislavLopac Owned by: nobody
Component: Testing framework Version: 1.3
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no


In Django 1.3, running a test or test case using a full label (e.g. test appname.TestCaseClass.test_name as opposed to just test appname ) fails with the message: ValueError: Test label 'appname.TestCaseClass.test_name' does not refer to a test.

The exact same test code runs fine when run as part of a full suite ( text appname ), as well as on Django 1.2.

Change History (3)

comment:1 Changed 5 years ago by lukeplant

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to worksforme
  • Status changed from new to closed

I can't reproduce this - it works fine for me on Django 1.3 and trunk. You'll need to provide more information to show this is a bug in Django and not in your code. However, I think this may well be #15638 you are describing, which is fixed in trunk.

comment:2 Changed 4 years ago by aigarius

  • Easy pickings set
  • Resolution worksforme deleted
  • Status changed from closed to reopened
  • UI/UX unset
  • Version changed from 1.3 to 1.4

This issue shows up if the tests are defined in the application using the suite(). The django.test.simple.build_suite() function has support for such arrangement (which is why testing the whole app works), but django.test.simple.build_test() does not which is why running a single test class or test case fails with the above error. The fix would be to call build_suite in build_test and then iterate over the TestSuite, just like it is done in the Doctest code in the same function.

comment:3 Changed 4 years ago by lrekucki

  • Easy pickings unset
  • Resolution set to worksforme
  • Status changed from reopened to closed
  • Version changed from 1.4 to 1.3

@aigarius, considering that build_test() method did not change from Django 1.2 to 1.3 (or 1.4 even), the issue you are describing doesn't match description of this one. Please create a new issue describing your problem. Thanks.

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