~ubuntu-branches/ubuntu/wily/nose2/wily

« back to all changes in this revision

Viewing changes to nose2/tests/functional/support/scenario/layers_and_attributes/test_layers_and_attributes.py

  • Committer: Package Import Robot
  • Author(s): Barry Warsaw
  • Date: 2013-09-09 22:14:45 UTC
  • Revision ID: package-import@ubuntu.com-20130909221445-zdvvvebxfucvavw5
Tags: upstream-0.4.7
ImportĀ upstreamĀ versionĀ 0.4.7

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
from nose2.compat import unittest
 
2
 
 
3
STATE = {}
 
4
 
 
5
 
 
6
class L1(object):
 
7
 
 
8
    @classmethod
 
9
    def setUp(cls):
 
10
        STATE['L1'] = 'setup'
 
11
 
 
12
    @classmethod
 
13
    def tearDown(cls):
 
14
        del STATE['L1']
 
15
 
 
16
 
 
17
class L2(object):
 
18
 
 
19
    @classmethod
 
20
    def setUp(cls):
 
21
        STATE['L2'] = 'setup'
 
22
 
 
23
    @classmethod
 
24
    def tearDown(cls):
 
25
        del STATE['L2']
 
26
 
 
27
 
 
28
class LayerAndAttributesA(unittest.TestCase):
 
29
    layer = L1
 
30
    a = 1
 
31
 
 
32
    def test(self):
 
33
        self.assertEqual(STATE.get('L1'), 'setup')
 
34
 
 
35
 
 
36
class LayerAndAttributesB(unittest.TestCase):
 
37
    layer = L2
 
38
    b = 1
 
39
 
 
40
    def test(self):
 
41
        self.assertEqual(STATE.get('L2'), 'setup')