summaryrefslogtreecommitdiff
path: root/functional_tests
diff options
context:
space:
mode:
authorkumar <kumar.mcmillan@gmail.com>2011-04-01 12:54:07 -0500
committerkumar <kumar.mcmillan@gmail.com>2011-04-01 12:54:07 -0500
commitf5e049ef02f90f0d13cb11bce8bdce265b566724 (patch)
tree7c443b6217461ecde3e637bb1af360c75d4f5bca /functional_tests
parentb0b42b1c1181209989221869ab02e54799d444da (diff)
downloadnose-f5e049ef02f90f0d13cb11bce8bdce265b566724.tar.gz
Fixes case where teardown_class() was called more than once (Issue 408)
Diffstat (limited to 'functional_tests')
-rw-r--r--functional_tests/support/issue408/test.py16
-rw-r--r--functional_tests/test_issue_408.py25
2 files changed, 41 insertions, 0 deletions
diff --git a/functional_tests/support/issue408/test.py b/functional_tests/support/issue408/test.py
new file mode 100644
index 0000000..a5e88e9
--- /dev/null
+++ b/functional_tests/support/issue408/test.py
@@ -0,0 +1,16 @@
+class base:
+ @classmethod
+ def setup_class(cls):
+ cls.inited = 1
+ @classmethod
+ def teardown_class(cls):
+ cls.inited = 0
+ def test1(self):
+ assert self.inited
+ def test2(self):
+ assert self.inited
+
+class testa(base):
+ pass
+class testb(base):
+ pass
diff --git a/functional_tests/test_issue_408.py b/functional_tests/test_issue_408.py
new file mode 100644
index 0000000..17ea65c
--- /dev/null
+++ b/functional_tests/test_issue_408.py
@@ -0,0 +1,25 @@
+import os
+import unittest
+
+from nose.plugins import Plugin, PluginTester
+#from nose.plugins.builtin import FailureDetail, Capture, Doctest
+
+support = os.path.join(os.path.dirname(__file__), 'support', 'issue408')
+
+class TestIssue408(PluginTester, unittest.TestCase):
+ args = ['--where='+support, 'test:testa.test1', 'test:testa.test2', 'test:testb.test1', 'test:testb.test2']
+ activate = "-v"
+
+ def makeSuite(self):
+ # make PluginTester happy, because we don't specify suitepath, we
+ # have to implement this function
+ return None
+
+ def test_no_failure(self):
+ output = str(self.output)
+ assert 'FAIL:' not in output
+ assert 'AssertionError' not in output
+ assert 'OK' in output
+
+if __name__ == '__main__':
+ unittest.main()