summaryrefslogtreecommitdiff
path: root/unit_tests/test_issue155.rst
diff options
context:
space:
mode:
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-08-29 12:32:40 +0300
committerMarkus Lehtonen <markus.lehtonen@linux.intel.com>2013-08-29 12:32:40 +0300
commitc07e4756def1c264799e682b10a052d8791d30cc (patch)
tree7936cea8ff6502caca0756e29af5068a0a35ff4e /unit_tests/test_issue155.rst
downloadpython-nose-c07e4756def1c264799e682b10a052d8791d30cc.tar.gz
python-nose-c07e4756def1c264799e682b10a052d8791d30cc.tar.bz2
python-nose-c07e4756def1c264799e682b10a052d8791d30cc.zip
Imported Upstream version 0.11.4upstream/0.11.4
Diffstat (limited to 'unit_tests/test_issue155.rst')
-rw-r--r--unit_tests/test_issue155.rst46
1 files changed, 46 insertions, 0 deletions
diff --git a/unit_tests/test_issue155.rst b/unit_tests/test_issue155.rst
new file mode 100644
index 0000000..450866a
--- /dev/null
+++ b/unit_tests/test_issue155.rst
@@ -0,0 +1,46 @@
+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