@@ 105-117 (lines=13) @@ | ||
102 | assert Test().ns.foo == 4 |
|
103 | ||
104 | ||
105 | def test_redundant_resume(namespaces): |
|
106 | class Test(namespaces.Namespaceable): |
|
107 | foo = 1 |
|
108 | with namespaces.Namespace() as ns: |
|
109 | foo = 2 |
|
110 | assert foo == 2 |
|
111 | foo = 3 |
|
112 | ns = ns |
|
113 | with ns as ns: |
|
114 | foo = 4 |
|
115 | assert foo == 3 |
|
116 | assert Test().foo == 3 |
|
117 | assert Test().ns.foo == 4 |
|
118 | ||
119 | ||
120 | def test_basic_inherit(namespaces): |
|
@@ 91-102 (lines=12) @@ | ||
88 | assert Test().ns.foo == 2 |
|
89 | ||
90 | ||
91 | def test_resume(namespaces): |
|
92 | class Test(namespaces.Namespaceable): |
|
93 | foo = 1 |
|
94 | with namespaces.Namespace() as ns: |
|
95 | foo = 2 |
|
96 | assert foo == 2 |
|
97 | foo = 3 |
|
98 | with ns: |
|
99 | foo = 4 |
|
100 | assert foo == 3 |
|
101 | assert Test().foo == 3 |
|
102 | assert Test().ns.foo == 4 |
|
103 | ||
104 | ||
105 | def test_redundant_resume(namespaces): |