~ubuntu-branches/debian/squeeze/nose/squeeze

« back to all changes in this revision

Viewing changes to functional_tests/test_isolate_plugin.py

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Marek, Torsten Marek, Gustavo Noronha Silva
  • Date: 2008-06-12 13:39:43 UTC
  • mfrom: (1.2.1 upstream) (2.1.5 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080612133943-2q7syp67fwl4on13
Tags: 0.10.3-1

[Torsten Marek]
* New upstream release (Closes: #461994)
* debian/control
  - bump standards version to 3.8.0, no changes necessary
  - add suggestions for python-coverage (Closes: #457053)
  - change dependency on python-setuptools into 
    python-pkg-resources (Closes: #468719)
  - added myself to uploaders

[Gustavo Noronha Silva]
* debian/control:
  - remove -1 from build-dep on setuptools

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
import os
 
2
import sys
 
3
import unittest
 
4
from nose.plugins.isolate import IsolationPlugin
 
5
from nose.plugins import PluginTester
 
6
 
 
7
support = os.path.join(os.path.dirname(__file__), 'support')
 
8
 
 
9
class TestDiscovery(PluginTester, unittest.TestCase):
 
10
    activate = '--with-isolation'
 
11
    args = ['-v']
 
12
    plugins = [IsolationPlugin()]
 
13
    suitepath = os.path.join(support, 'ipt')
 
14
    
 
15
    def runTest(self):
 
16
        print str(self.output)
 
17
 
 
18
        for line in self.output:
 
19
            if not line.strip():
 
20
                continue
 
21
            if line.startswith('-'):
 
22
                break
 
23
            assert line.strip().endswith('ok'), \
 
24
                   "Failed test: %s" % line.strip()
 
25
 
 
26
 
 
27
class TestLoadFromNames(PluginTester, unittest.TestCase):
 
28
    activate = '--with-isolation'
 
29
    args = ['-v', 'test1/tests.py', 'test2/tests.py']
 
30
    plugins = [IsolationPlugin()]
 
31
    suitepath = None
 
32
 
 
33
    def setUp(self):
 
34
        self._dir = os.getcwd()
 
35
        os.chdir(os.path.join(support, 'ipt'))
 
36
        super(TestLoadFromNames, self).setUp()
 
37
        
 
38
    def tearDown(self):
 
39
        os.chdir(self._dir)
 
40
        super(TestLoadFromNames, self).tearDown()
 
41
 
 
42
    def makeSuite(self):
 
43
        return None
 
44
    
 
45
    def runTest(self):
 
46
        print str(self.output)
 
47
 
 
48
        for line in self.output:
 
49
            if not line.strip():
 
50
                continue
 
51
            if line.startswith('-'):
 
52
                break
 
53
            assert line.strip().endswith('ok'), \
 
54
                   "Failed test: %s" % line.strip()
 
55
 
 
56
if __name__ == '__main__':
 
57
    unittest.main()