blob: f73d02b0670ba031e280d8962600767d547c6811 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
import os
import unittest
from nose.plugins import PluginTester
from nose.plugins.skip import SkipTest
from nose.plugins.multiprocess import MultiProcess
support = os.path.join(os.path.dirname(__file__), 'support')
def setup():
try:
import multiprocessing
if 'active' in MultiProcess.status:
raise SkipTest("Multiprocess plugin is active. Skipping tests of "
"plugin itself.")
except ImportError:
raise SkipTest("multiprocessing module not available")
class TestMPNameError(PluginTester, unittest.TestCase):
activate = '--processes=2'
plugins = [MultiProcess()]
suitepath = os.path.join(support, 'nameerror.py')
def runTest(self):
print str(self.output)
assert 'NameError' in self.output
assert "'undefined_variable' is not defined" in self.output
|