Former-commit-id:2b462d8665
[formerly133dc97f67
] [formerlya02aeb236c
] [formerlya02aeb236c
[formerly9f19e3f712
]] [formerly2b462d8665
[formerly133dc97f67
] [formerlya02aeb236c
] [formerlya02aeb236c
[formerly9f19e3f712
]] [formerly06a8b51d6d
[formerlya02aeb236c
[formerly9f19e3f712
] [formerly06a8b51d6d
[formerly 64fa9254b946eae7e61bbc3f513b7c3696c4f54f]]]]] Former-commit-id:06a8b51d6d
Former-commit-id:2c3569dd39
[formerly9bb8decbcf
] [formerly8e80217e59
] [formerlye2ecdcfe33
[formerly377dcd10b9
] [formerly8e80217e59
[formerly3360eb6c5f
]]] Former-commit-id:e2ecdcfe33
[formerly377dcd10b9
] Former-commit-id:e2ecdcfe33
Former-commit-id:7dbd17a5aa
46 lines
1.3 KiB
ReStructuredText
Executable file
46 lines
1.3 KiB
ReStructuredText
Executable file
AttributeError from a method call should not be hidden by exception
|
|
handling intended to ignore the case where the method is not present.
|
|
|
|
>>> import sys
|
|
>>> import unittest
|
|
|
|
>>> import nose.case
|
|
>>> import nose.proxy
|
|
>>> import nose.result
|
|
>>> import nose.util
|
|
>>> import nose.plugins.doctests
|
|
|
|
>>> class Result(nose.result.TextTestResult):
|
|
...
|
|
... def afterTest(self, test):
|
|
... raise AttributeError("bug in Result")
|
|
...
|
|
... def beforeTest(self, test):
|
|
... raise AttributeError("bug in Result")
|
|
|
|
>>> class TestCase(unittest.TestCase):
|
|
...
|
|
... def address(self):
|
|
... raise AttributeError("bug in TestCase")
|
|
...
|
|
... def runTest(self):
|
|
... pass
|
|
|
|
|
|
>>> test = nose.case.Test(TestCase())
|
|
>>> result = Result(sys.stdout, True, 1)
|
|
>>> proxy = nose.proxy.ResultProxy(result, test)
|
|
>>> proxy.beforeTest(test)
|
|
Traceback (most recent call last):
|
|
AttributeError: bug in Result
|
|
>>> proxy.afterTest(test)
|
|
Traceback (most recent call last):
|
|
AttributeError: bug in Result
|
|
|
|
>>> test.address()
|
|
Traceback (most recent call last):
|
|
AttributeError: bug in TestCase
|
|
|
|
>>> nose.util.test_address(test)
|
|
Traceback (most recent call last):
|
|
AttributeError: bug in TestCase
|