Skip to content

Commit

Permalink
fix for #189
Browse files Browse the repository at this point in the history
  • Loading branch information
dnozay committed Mar 21, 2019
1 parent 6d8ea8f commit 566000f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
14 changes: 14 additions & 0 deletions tests/testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,20 @@ def validate_junit_report(text):
JUnitSchema.assertValid(document)


class TestCaseSubclassWithNoSuper(unittest.TestCase):
def __init__(self, description):
# no super, see #189
pass

def run(self, result):
result = _XMLTestResult()
result.startTest(self)
result.stopTest(self)

def test_something(self):
pass


class DoctestTest(unittest.TestCase):

def test_doctest_example(self):
Expand Down
4 changes: 2 additions & 2 deletions xmlrunner/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,8 +271,8 @@ def startTest(self, test):
# Handle partial and partialmethod objects.
test_method = getattr(test_method, 'func', test_method)
_, self.lineno = inspect.getsourcelines(test_method)
except TypeError:
# issue #188, some frameworks can make test method opaque.
except (AttributeError, TypeError):
# issue #188, #189, some frameworks can make test method opaque.
pass

if self.showAll:
Expand Down

0 comments on commit 566000f

Please sign in to comment.