File: __init__.py

package info (click to toggle)
nose 1.3.7-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 2,900 kB
  • sloc: python: 15,733; makefile: 99; xml: 42; sh: 2
file content (28 lines) | stat: -rw-r--r-- 900 bytes parent folder | download | duplicates (6)
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
import os
from unittest import TestCase

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 MPTestBase(PluginTester, TestCase):
    processes = 1
    activate = '--processes=1'
    plugins = [MultiProcess()]
    suitepath = os.path.join(support, 'timeout.py')

    def __init__(self, *args, **kwargs):
        self.activate = '--processes=%d' % self.processes
        PluginTester.__init__(self)
        TestCase.__init__(self, *args, **kwargs)