Skip to content

Commit 566000f

Browse files
committed
fix for #189
1 parent 6d8ea8f commit 566000f

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

tests/testsuite.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,20 @@ def validate_junit_report(text):
5050
JUnitSchema.assertValid(document)
5151

5252

53+
class TestCaseSubclassWithNoSuper(unittest.TestCase):
54+
def __init__(self, description):
55+
# no super, see #189
56+
pass
57+
58+
def run(self, result):
59+
result = _XMLTestResult()
60+
result.startTest(self)
61+
result.stopTest(self)
62+
63+
def test_something(self):
64+
pass
65+
66+
5367
class DoctestTest(unittest.TestCase):
5468

5569
def test_doctest_example(self):

xmlrunner/result.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@ def startTest(self, test):
271271
# Handle partial and partialmethod objects.
272272
test_method = getattr(test_method, 'func', test_method)
273273
_, self.lineno = inspect.getsourcelines(test_method)
274-
except TypeError:
275-
# issue #188, some frameworks can make test method opaque.
274+
except (AttributeError, TypeError):
275+
# issue #188, #189, some frameworks can make test method opaque.
276276
pass
277277

278278
if self.showAll:

0 commit comments

Comments
 (0)