Opened 7 years ago

Last modified 7 years ago

#28869 closed Bug

Django.test.tag Inconsistent Inheritance — at Version 1

Reported by: William Ayd Owned by: nobody
Component: Testing framework Version: 1.11
Severity: Normal Keywords: testing, tag
Cc: Hrishikesh Barman Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Hrishikesh Barman)

When subclassing test cases, decorated tags are inherited ONLY when the subclass does not provide its own tag decorator. If the subclass provides its own decorator(s) then the parent's tags are ignored.

If you use the attached file, running:

python manage.py test

yields two test cases as expected. However, running

python manage.py test --tag=foo-tests

OR

python manage.py test --tag=baz-tests

Will each only run one test a piece. I would expect that the former would run both test cases, given all of the test cases in the attached file are inherited from a class which is decorated with that tag.

Change History (2)

by William Ayd, 7 years ago

Attachment: test_foo.py added

test_foo.py

comment:1 by Hrishikesh Barman, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top