Opened 14 years ago
Closed 14 years ago
#16372 closed Bug (fixed)
TransactionTestCase doesn't count skipped cases in test result.
| Reported by: | Piotr Czachur | Owned by: | nobody |
|---|---|---|---|
| Component: | Testing framework | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Accepted | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | yes | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description
In r16369 return was added for test cases decorated with unittest.skip:
Index: django/trunk/django/test/testcases.py
===================================================================
--- a/django/trunk/django/test/testcases.py
+++ b/django/trunk/django/test/testcases.py
@@ -283,4 +283,9 @@
include a call to super().setUp().
"""
+ testMethod = getattr(self, self._testMethodName)
+ if (getattr(self.__class__, "__unittest_skip__", False) or
+ getattr(testMethod, "__unittest_skip__", False)):
+ return
This should solve the problem:
self._addSkip(result, skip_why)
Cheers!
Attachments (1)
Change History (5)
by , 14 years ago
| Attachment: | test-result-bugfix.diff added |
|---|
comment:1 by , 14 years ago
| Has patch: | set |
|---|
comment:2 by , 14 years ago
| Needs tests: | set |
|---|
comment:3 by , 14 years ago
| Triage Stage: | Unreviewed → Accepted |
|---|
Note:
See TracTickets
for help on using tickets.
I've just attached patch. In fact, TransactionTestCase.call() for skipped tests is missing three method calls: