Skip to content

Commit 58ff4ff

Browse files
committed
Expand the debugging example, including several samples of potential
issues
1 parent 1d88f4d commit 58ff4ff

File tree

4 files changed

+395
-22
lines changed

4 files changed

+395
-22
lines changed

doc/examples/debugging-logging.out

Lines changed: 261 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ $ pytest --log-cli-format='%(levelname)s: %(message)s' --log-cli-level=DEBUG deb
22
============================= test session starts ==============================
33
platform linux -- Python 3.10.1, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
44
rootdir: /home/user
5-
plugins: dependency-0.5.1
6-
collected 5 items
5+
plugins: dependency-0.6.0
6+
collected 25 items
77

88
debugging.py::test_a
99
-------------------------------- live log setup --------------------------------
@@ -12,7 +12,7 @@ DEBUG: register setup test_a passed in module scope
1212
-------------------------------- live log call ---------------------------------
1313
DEBUG: register call debugging.py::test_a skipped in session scope
1414
DEBUG: register call test_a skipped in module scope
15-
XFAIL (deliberate fail) [ 20%]
15+
XFAIL (deliberate fail) [ 4%]
1616
------------------------------ live log teardown -------------------------------
1717
DEBUG: register teardown debugging.py::test_a passed in session scope
1818
DEBUG: register teardown test_a passed in module scope
@@ -24,7 +24,7 @@ DEBUG: register setup test_b passed in module scope
2424
-------------------------------- live log call ---------------------------------
2525
DEBUG: register call debugging.py::test_b passed in session scope
2626
DEBUG: register call test_b passed in module scope
27-
PASSED [ 40%]
27+
PASSED [ 8%]
2828
------------------------------ live log teardown -------------------------------
2929
DEBUG: register teardown debugging.py::test_b passed in session scope
3030
DEBUG: register teardown test_b passed in module scope
@@ -36,7 +36,7 @@ DEBUG: ... test_a has not succeeded
3636
INFO: skip test_c because it depends on test_a
3737
DEBUG: register setup debugging.py::test_c skipped in session scope
3838
DEBUG: register setup test_c skipped in module scope
39-
SKIPPED (test_c depends on test_a) [ 60%]
39+
SKIPPED (test_c depends on test_a) [ 12%]
4040
------------------------------ live log teardown -------------------------------
4141
DEBUG: register teardown debugging.py::test_c passed in session scope
4242
DEBUG: register teardown test_c passed in module scope
@@ -50,7 +50,7 @@ DEBUG: register setup test_d passed in module scope
5050
-------------------------------- live log call ---------------------------------
5151
DEBUG: register call debugging.py::test_d passed in session scope
5252
DEBUG: register call test_d passed in module scope
53-
PASSED [ 80%]
53+
PASSED [ 16%]
5454
------------------------------ live log teardown -------------------------------
5555
DEBUG: register teardown debugging.py::test_d passed in session scope
5656
DEBUG: register teardown test_d passed in module scope
@@ -63,10 +63,263 @@ DEBUG: ... test_c has not succeeded
6363
INFO: skip test_e because it depends on test_c
6464
DEBUG: register setup debugging.py::test_e skipped in session scope
6565
DEBUG: register setup test_e skipped in module scope
66-
SKIPPED (test_e depends on test_c) [100%]
66+
SKIPPED (test_e depends on test_c) [ 20%]
6767
------------------------------ live log teardown -------------------------------
6868
DEBUG: register teardown debugging.py::test_e passed in session scope
6969
DEBUG: register teardown test_e passed in module scope
7070

71+
debugging.py::TestClass::test_a
72+
-------------------------------- live log setup --------------------------------
73+
DEBUG: register setup debugging.py::TestClass::test_a passed in session scope
74+
DEBUG: register setup TestClass::test_a passed in module scope
75+
DEBUG: register setup test_a passed in class scope
76+
-------------------------------- live log call ---------------------------------
77+
DEBUG: register call debugging.py::TestClass::test_a passed in session scope
78+
DEBUG: register call TestClass::test_a passed in module scope
79+
DEBUG: register call test_a passed in class scope
80+
PASSED [ 24%]
81+
------------------------------ live log teardown -------------------------------
82+
DEBUG: register teardown debugging.py::TestClass::test_a passed in session scope
83+
DEBUG: register teardown TestClass::test_a passed in module scope
84+
DEBUG: register teardown test_a passed in class scope
85+
86+
debugging.py::TestClass::test_b
87+
-------------------------------- live log setup --------------------------------
88+
DEBUG: register setup debugging.py::TestClass::test_b passed in session scope
89+
DEBUG: register setup TestClass::test_b passed in module scope
90+
DEBUG: register setup test_b passed in class scope
91+
-------------------------------- live log call ---------------------------------
92+
DEBUG: register call debugging.py::TestClass::test_b skipped in session scope
93+
DEBUG: register call TestClass::test_b skipped in module scope
94+
DEBUG: register call test_b skipped in class scope
95+
XFAIL (deliberate fail) [ 28%]
96+
------------------------------ live log teardown -------------------------------
97+
DEBUG: register teardown debugging.py::TestClass::test_b passed in session scope
98+
DEBUG: register teardown TestClass::test_b passed in module scope
99+
DEBUG: register teardown test_b passed in class scope
100+
101+
debugging.py::TestClass::test_c
102+
-------------------------------- live log setup --------------------------------
103+
DEBUG: check dependencies of test_c in module scope ...
104+
DEBUG: ... test_b succeeded
105+
DEBUG: register setup debugging.py::TestClass::test_c passed in session scope
106+
DEBUG: register setup TestClass::test_c passed in module scope
107+
DEBUG: register setup test_c passed in class scope
108+
-------------------------------- live log call ---------------------------------
109+
DEBUG: register call debugging.py::TestClass::test_c passed in session scope
110+
DEBUG: register call TestClass::test_c passed in module scope
111+
DEBUG: register call test_c passed in class scope
112+
PASSED [ 32%]
113+
------------------------------ live log teardown -------------------------------
114+
DEBUG: register teardown debugging.py::TestClass::test_c passed in session scope
115+
DEBUG: register teardown TestClass::test_c passed in module scope
116+
DEBUG: register teardown test_c passed in class scope
117+
118+
debugging.py::test_colors[RED]
119+
-------------------------------- live log setup --------------------------------
120+
DEBUG: register setup debugging.py::test_colors[RED] passed in session scope
121+
DEBUG: register setup test_colors[RED] passed in module scope
122+
-------------------------------- live log call ---------------------------------
123+
DEBUG: register call debugging.py::test_colors[RED] passed in session scope
124+
DEBUG: register call test_colors[RED] passed in module scope
125+
PASSED [ 36%]
126+
------------------------------ live log teardown -------------------------------
127+
DEBUG: register teardown debugging.py::test_colors[RED] passed in session scope
128+
DEBUG: register teardown test_colors[RED] passed in module scope
129+
130+
debugging.py::test_colors[GREEN]
131+
-------------------------------- live log setup --------------------------------
132+
DEBUG: register setup debugging.py::test_colors[GREEN] passed in session scope
133+
DEBUG: register setup test_colors[GREEN] passed in module scope
134+
-------------------------------- live log call ---------------------------------
135+
DEBUG: register call debugging.py::test_colors[GREEN] passed in session scope
136+
DEBUG: register call test_colors[GREEN] passed in module scope
137+
PASSED [ 40%]
138+
------------------------------ live log teardown -------------------------------
139+
DEBUG: register teardown debugging.py::test_colors[GREEN] passed in session scope
140+
DEBUG: register teardown test_colors[GREEN] passed in module scope
141+
142+
debugging.py::test_colors[BLUE]
143+
-------------------------------- live log setup --------------------------------
144+
DEBUG: register setup debugging.py::test_colors[BLUE] passed in session scope
145+
DEBUG: register setup test_colors[BLUE] passed in module scope
146+
-------------------------------- live log call ---------------------------------
147+
DEBUG: register call debugging.py::test_colors[BLUE] passed in session scope
148+
DEBUG: register call test_colors[BLUE] passed in module scope
149+
PASSED [ 44%]
150+
------------------------------ live log teardown -------------------------------
151+
DEBUG: register teardown debugging.py::test_colors[BLUE] passed in session scope
152+
DEBUG: register teardown test_colors[BLUE] passed in module scope
153+
154+
debugging.py::test_multicolored
155+
-------------------------------- live log setup --------------------------------
156+
DEBUG: check dependencies of test_multicolored in module scope ...
157+
DEBUG: ... test_colors is unknown
158+
INFO: skip test_multicolored because it depends on test_colors
159+
DEBUG: register setup debugging.py::test_multicolored skipped in session scope
160+
DEBUG: register setup test_multicolored skipped in module scope
161+
SKIPPED (test_multicolored depends on test_colors) [ 48%]
162+
------------------------------ live log teardown -------------------------------
163+
DEBUG: register teardown debugging.py::test_multicolored passed in session scope
164+
DEBUG: register teardown test_multicolored passed in module scope
165+
166+
debugging.py::test_alert
167+
-------------------------------- live log setup --------------------------------
168+
DEBUG: check dependencies of test_alert in module scope ...
169+
DEBUG: ... test_colors[Color.RED] is unknown
170+
INFO: skip test_alert because it depends on test_colors[Color.RED]
171+
DEBUG: register setup debugging.py::test_alert skipped in session scope
172+
DEBUG: register setup test_alert skipped in module scope
173+
SKIPPED (test_alert depends on test_colors[Color.RED]) [ 52%]
174+
------------------------------ live log teardown -------------------------------
175+
DEBUG: register teardown debugging.py::test_alert passed in session scope
176+
DEBUG: register teardown test_alert passed in module scope
177+
178+
debugging.py::test_g
179+
-------------------------------- live log setup --------------------------------
180+
DEBUG: check dependencies of test_g in module scope ...
181+
DEBUG: ... test_f is unknown
182+
INFO: skip test_g because it depends on test_f
183+
DEBUG: register setup debugging.py::test_g skipped in session scope
184+
DEBUG: register setup test_g skipped in module scope
185+
SKIPPED (test_g depends on test_f) [ 56%]
186+
------------------------------ live log teardown -------------------------------
187+
DEBUG: register teardown debugging.py::test_g passed in session scope
188+
DEBUG: register teardown test_g passed in module scope
189+
190+
debugging.py::test_h
191+
-------------------------------- live log setup --------------------------------
192+
DEBUG: register setup h passed in session scope
193+
DEBUG: register setup h passed in module scope
194+
-------------------------------- live log call ---------------------------------
195+
DEBUG: register call h passed in session scope
196+
DEBUG: register call h passed in module scope
197+
PASSED [ 60%]
198+
------------------------------ live log teardown -------------------------------
199+
DEBUG: register teardown h passed in session scope
200+
DEBUG: register teardown h passed in module scope
201+
202+
debugging.py::test_k
203+
-------------------------------- live log setup --------------------------------
204+
DEBUG: check dependencies of test_k in module scope ...
205+
DEBUG: ... test_b succeeded
206+
DEBUG: register setup debugging.py::test_k passed in session scope
207+
DEBUG: register setup test_k passed in module scope
208+
-------------------------------- live log call ---------------------------------
209+
DEBUG: register call debugging.py::test_k skipped in session scope
210+
DEBUG: register call test_k skipped in module scope
211+
SKIPPED (could not import 'fleet': No module named 'fleet') [ 64%]
212+
------------------------------ live log teardown -------------------------------
213+
DEBUG: register teardown debugging.py::test_k passed in session scope
214+
DEBUG: register teardown test_k passed in module scope
215+
216+
debugging.py::test_l[0]
217+
-------------------------------- live log setup --------------------------------
218+
DEBUG: register setup debugging.py::test_l[0] passed in session scope
219+
DEBUG: register setup test_l[0] passed in module scope
220+
-------------------------------- live log call ---------------------------------
221+
DEBUG: register call debugging.py::test_l[0] passed in session scope
222+
DEBUG: register call test_l[0] passed in module scope
223+
PASSED [ 68%]
224+
------------------------------ live log teardown -------------------------------
225+
DEBUG: register teardown debugging.py::test_l[0] passed in session scope
226+
DEBUG: register teardown test_l[0] passed in module scope
227+
228+
debugging.py::test_q[0]
229+
-------------------------------- live log setup --------------------------------
230+
DEBUG: check dependencies of test_q[0] in module scope ...
231+
DEBUG: ... test_p is unknown
232+
INFO: skip test_q[0] because it depends on test_p
233+
DEBUG: register setup debugging.py::test_q[0] skipped in session scope
234+
DEBUG: register setup test_q[0] skipped in module scope
235+
SKIPPED (test_q[0] depends on test_p) [ 72%]
236+
------------------------------ live log teardown -------------------------------
237+
DEBUG: register teardown debugging.py::test_q[0] passed in session scope
238+
DEBUG: register teardown test_q[0] passed in module scope
239+
240+
debugging.py::test_l[1]
241+
-------------------------------- live log setup --------------------------------
242+
DEBUG: register setup debugging.py::test_l[1] passed in session scope
243+
DEBUG: register setup test_l[1] passed in module scope
244+
-------------------------------- live log call ---------------------------------
245+
DEBUG: register call debugging.py::test_l[1] passed in session scope
246+
DEBUG: register call test_l[1] passed in module scope
247+
PASSED [ 76%]
248+
------------------------------ live log teardown -------------------------------
249+
DEBUG: register teardown debugging.py::test_l[1] passed in session scope
250+
DEBUG: register teardown test_l[1] passed in module scope
251+
252+
debugging.py::test_q[1]
253+
-------------------------------- live log setup --------------------------------
254+
DEBUG: check dependencies of test_q[1] in module scope ...
255+
DEBUG: ... test_p is unknown
256+
INFO: skip test_q[1] because it depends on test_p
257+
DEBUG: register setup debugging.py::test_q[1] skipped in session scope
258+
DEBUG: register setup test_q[1] skipped in module scope
259+
SKIPPED (test_q[1] depends on test_p) [ 80%]
260+
------------------------------ live log teardown -------------------------------
261+
DEBUG: register teardown debugging.py::test_q[1] passed in session scope
262+
DEBUG: register teardown test_q[1] passed in module scope
263+
264+
debugging.py::test_m
265+
-------------------------------- live log setup --------------------------------
266+
DEBUG: check dependencies of test_m in session scope ...
267+
DEBUG: ... test_b is unknown
268+
INFO: skip test_m because it depends on test_b
269+
DEBUG: register setup debugging.py::test_m skipped in session scope
270+
DEBUG: register setup test_m skipped in module scope
271+
SKIPPED (test_m depends on test_b) [ 84%]
272+
------------------------------ live log teardown -------------------------------
273+
DEBUG: register teardown debugging.py::test_m passed in session scope
274+
DEBUG: register teardown test_m passed in module scope
275+
276+
debugging.py::test_o
277+
-------------------------------- live log setup --------------------------------
278+
DEBUG: check dependencies of test_o in module scope ...
279+
DEBUG: ... test_h is unknown
280+
INFO: skip test_o because it depends on test_h
281+
DEBUG: register setup debugging.py::test_o skipped in session scope
282+
DEBUG: register setup test_o skipped in module scope
283+
SKIPPED (test_o depends on test_h) [ 88%]
284+
------------------------------ live log teardown -------------------------------
285+
DEBUG: register teardown debugging.py::test_o passed in session scope
286+
DEBUG: register teardown test_o passed in module scope
287+
288+
debugging.py::test_p
289+
-------------------------------- live log setup --------------------------------
290+
DEBUG: register setup debugging.py::test_p passed in session scope
291+
DEBUG: register setup test_p passed in module scope
292+
-------------------------------- live log call ---------------------------------
293+
DEBUG: register call debugging.py::test_p passed in session scope
294+
DEBUG: register call test_p passed in module scope
295+
PASSED [ 92%]
296+
------------------------------ live log teardown -------------------------------
297+
DEBUG: register teardown debugging.py::test_p passed in session scope
298+
DEBUG: register teardown test_p passed in module scope
299+
300+
debugging.py::test_r
301+
-------------------------------- live log setup --------------------------------
302+
DEBUG: register setup r passed in session scope
303+
DEBUG: register setup r passed in module scope
304+
-------------------------------- live log call ---------------------------------
305+
DEBUG: register call r passed in session scope
306+
DEBUG: register call r passed in module scope
307+
PASSED [ 96%]
308+
------------------------------ live log teardown -------------------------------
309+
DEBUG: register teardown r passed in session scope
310+
DEBUG: register teardown r passed in module scope
311+
312+
debugging.py::test_s
313+
-------------------------------- live log setup --------------------------------
314+
DEBUG: check dependencies of test_s in module scope ...
315+
DEBUG: ... test_l is unknown
316+
INFO: skip test_s because it depends on test_l
317+
DEBUG: register setup debugging.py::test_s skipped in session scope
318+
DEBUG: register setup test_s skipped in module scope
319+
SKIPPED (test_s depends on test_l) [100%]
320+
------------------------------ live log teardown -------------------------------
321+
DEBUG: register teardown debugging.py::test_s passed in session scope
322+
DEBUG: register teardown test_s passed in module scope
323+
71324

72-
=================== 2 passed, 2 skipped, 1 xfailed in 0.03s ====================
325+
================== 12 passed, 11 skipped, 2 xfailed in 0.09s ===================

0 commit comments

Comments
 (0)