summaryrefslogtreecommitdiff
path: root/functional_tests
diff options
context:
space:
mode:
authorjpellerin <devnull@localhost>2011-07-25 17:25:39 -0400
committerjpellerin <devnull@localhost>2011-07-25 17:25:39 -0400
commitbda95d5e9190b49ee6bc24c3a473d398097ef5e6 (patch)
tree39b8e0cb194517870f1ce2a5b5949f89fddf5fb3 /functional_tests
parent025ecba085e324099a8fe80a22b5ce76611607af (diff)
downloadnose-bda95d5e9190b49ee6bc24c3a473d398097ef5e6.tar.gz
Rewrote doctest as TestCase
Diffstat (limited to 'functional_tests')
-rw-r--r--functional_tests/test_multiprocessing/test_keyboardinterrupt.rst32
-rw-r--r--functional_tests/test_multiprocessing/test_keyboardinterrupt_fixtures.py8
-rw-r--r--functional_tests/test_multiprocessing/test_process_timeout.py24
3 files changed, 24 insertions, 40 deletions
diff --git a/functional_tests/test_multiprocessing/test_keyboardinterrupt.rst b/functional_tests/test_multiprocessing/test_keyboardinterrupt.rst
deleted file mode 100644
index 6d108dd..0000000
--- a/functional_tests/test_multiprocessing/test_keyboardinterrupt.rst
+++ /dev/null
@@ -1,32 +0,0 @@
- >>> from os.path import join, dirname
- >>> from nose.plugins.plugintest import run_buffered
- >>> from nose.plugins.multiprocess import MultiProcess
-
- >>> run_buffered( argv=[
- ... 'nosetests', '--processes=2', '--process-timeout=1',
- ... join(dirname(__file__), 'support', 'timeout.py')
- ... ], plugins=[MultiProcess()])
- E
- ======================================================================
- ERROR: this test *should* fail when process-timeout=1
- ----------------------------------------------------------------------
- Traceback (most recent call last):
- ...
- TimedOutException: 'timeout.test_timeout'
- <BLANKLINE>
- ----------------------------------------------------------------------
- Ran 1 test in ...s
- <BLANKLINE>
- FAILED (errors=1)
-
- >>> run_buffered( argv=[
- ... 'nosetests', '--processes=2', '--process-timeout=3',
- ... join(dirname(__file__), 'support', 'timeout.py')
- ... ], plugins=[MultiProcess()])
- .
- ----------------------------------------------------------------------
- Ran 1 test in ...s
- <BLANKLINE>
- OK
-
-
diff --git a/functional_tests/test_multiprocessing/test_keyboardinterrupt_fixtures.py b/functional_tests/test_multiprocessing/test_keyboardinterrupt_fixtures.py
deleted file mode 100644
index 539de6d..0000000
--- a/functional_tests/test_multiprocessing/test_keyboardinterrupt_fixtures.py
+++ /dev/null
@@ -1,8 +0,0 @@
-
-def setup_module():
- try:
- import multiprocessing
- except ImportError:
- from nose.plugins.skip import SkipTest
- raise SkipTest("multiprocessing module not available")
-
diff --git a/functional_tests/test_multiprocessing/test_process_timeout.py b/functional_tests/test_multiprocessing/test_process_timeout.py
new file mode 100644
index 0000000..cf531a4
--- /dev/null
+++ b/functional_tests/test_multiprocessing/test_process_timeout.py
@@ -0,0 +1,24 @@
+import os
+import unittest
+
+from nose.plugins import PluginTester
+from nose.plugins.multiprocess import MultiProcess
+
+support = os.path.join(os.path.dirname(__file__), 'support')
+
+class TestMPTimeout(PluginTester, unittest.TestCase):
+ activate = '--processes=2'
+ args = ['--process-timeout=1']
+ plugins = [MultiProcess()]
+ suitepath = os.path.join(support, 'timeout.py')
+
+ def runTest(self):
+ assert "TimedOutException: 'timeout.test_timeout'" in self.output
+
+
+class TestMPTimeoutPass(TestMPTimeout):
+ args = ['--process-timeout=3']
+
+ def runTest(self):
+ assert "TimedOutException: 'timeout.test_timeout'" not in self.output
+ assert str(self.output).strip().endswith('OK')