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