File tree Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Expand file tree Collapse file tree 2 files changed +13
-18
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ Charles Machalow
6262Charnjit SiNGH (CCSJ)
6363Chris Lamb
6464Chris NeJame
65+ Chris Rose
6566Christian Boelsen
6667Christian Fetzer
6768Christian Neumüller
Original file line number Diff line number Diff line change @@ -169,40 +169,34 @@ This is outlined below:
169169
170170 # content of test_class_demo.py
171171 class TestClassDemoInstance :
172+ value = 0
173+
172174 def test_one (self ):
173- assert 0
175+ self .value = 1
176+ assert self .value == 1
174177
175178 def test_two (self ):
176- assert 0
179+ assert self .value == 1
177180
178181
179182 .. code-block :: pytest
180183
181184 $ pytest -k TestClassDemoInstance -q
182- FF [100%]
185+ .F [100%]
183186 ================================= FAILURES =================================
184- ______________________ TestClassDemoInstance.test_one ______________________
185-
186- self = <test_class_demo.TestClassDemoInstance object at 0xdeadbeef>
187-
188- def test_one(self):
189- > assert 0
190- E assert 0
191-
192- test_class_demo.py:3: AssertionError
193187 ______________________ TestClassDemoInstance.test_two ______________________
194188
195189 self = <test_class_demo.TestClassDemoInstance object at 0xdeadbeef>
196190
197191 def test_two(self):
198- > assert 0
199- E assert 0
192+ > assert self.value == 1
193+ E assert 0 == 1
194+ E + where 0 = <test_class_demo.TestClassDemoInstance object at 0xdeadbeef>.value
200195
201- test_class_demo.py:6 : AssertionError
196+ test_class_demo.py:9 : AssertionError
202197 ========================= short test summary info ==========================
203- FAILED test_class_demo.py::TestClassDemoInstance::test_one - assert 0
204- FAILED test_class_demo.py::TestClassDemoInstance::test_two - assert 0
205- 2 failed in 0.12s
198+ FAILED test_class_demo.py::TestClassDemoInstance::test_two - assert 0 == 1
199+ 1 failed, 1 passed in 0.04s
206200
207201 Note that attributes added at class level are *class attributes *, so they will be shared between tests.
208202
You can’t perform that action at this time.
0 commit comments