Opened 6 years ago

Last modified 6 years ago

#28869 closed Bug

Django.test.tag Inconsistent Inheritance — at Initial Version

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

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 (1)

by William Ayd, 6 years ago

Attachment: test_foo.py added

test_foo.py

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