@@ -86,7 +86,7 @@ def test_fixture_setup(mock_client_init):
8686 variables = dict (utils .DEFAULT_VARIABLES )
8787 variables ['rp_report_fixtures' ] = True
8888 test_path = 'examples/fixtures/test_fixture_setup'
89- result = utils .run_pytest_tests (tests = ['examples/fixtures/test_fixture_setup' ], variables = variables )
89+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
9090 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
9191
9292 start_count = mock_client .start_test_item .call_count
@@ -183,7 +183,8 @@ def test_fixture_setup_failure(mock_client_init):
183183
184184 variables = dict (utils .DEFAULT_VARIABLES )
185185 variables ['rp_report_fixtures' ] = True
186- result = utils .run_pytest_tests (tests = ['examples/fixtures/test_fixture_setup_failure' ], variables = variables )
186+ test_path = 'examples/fixtures/test_fixture_setup_failure'
187+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
187188 assert int (result ) == 1 , 'Exit code should be 1 (test failure)'
188189
189190 start_count = mock_client .start_test_item .call_count
@@ -195,7 +196,8 @@ def test_fixture_setup_failure(mock_client_init):
195196
196197 call_args = mock_client .start_test_item .call_args_list
197198 setup_call_args = call_args [1 ][0 ]
198- step_name = 'function fixture setup: fixture_setup_failure_config'
199+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
200+ step_name = f'function fixture setup: { fixture_name } '
199201 assert setup_call_args [0 ] == step_name
200202
201203 setup_call_kwargs = call_args [1 ][1 ]
@@ -230,7 +232,8 @@ def test_fixture_teardown_failure(mock_client_init):
230232
231233 variables = dict (utils .DEFAULT_VARIABLES )
232234 variables ['rp_report_fixtures' ] = True
233- result = utils .run_pytest_tests (tests = ['examples/fixtures/test_fixture_teardown_failure' ], variables = variables )
235+ test_path = 'examples/fixtures/test_fixture_teardown_failure'
236+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
234237 assert int (result ) == 1 , 'Exit code should be 1 (test failure)'
235238
236239 start_count = mock_client .start_test_item .call_count
@@ -239,14 +242,15 @@ def test_fixture_teardown_failure(mock_client_init):
239242
240243 call_args = mock_client .start_test_item .call_args_list
241244 setup_call_args = call_args [1 ][0 ]
242- setup_step_name = 'function fixture setup: fixture_teardown_failure_config'
245+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
246+ setup_step_name = f'function fixture setup: { fixture_name } '
243247 assert setup_call_args [0 ] == setup_step_name
244248
245249 setup_call_kwargs = call_args [1 ][1 ]
246250 assert not setup_call_kwargs ['has_stats' ]
247251
248252 teardown_call_args = call_args [- 1 ][0 ]
249- teardown_step_name = 'function fixture teardown: fixture_teardown_failure_config '
253+ teardown_step_name = f 'function fixture teardown: { fixture_name } '
250254 assert teardown_call_args [0 ] == teardown_step_name
251255
252256 setup_call_kwargs = call_args [- 1 ][1 ]
@@ -290,7 +294,8 @@ def test_fixture_yield_none(mock_client_init):
290294
291295 variables = dict (utils .DEFAULT_VARIABLES )
292296 variables ['rp_report_fixtures' ] = True
293- result = utils .run_pytest_tests (tests = ['examples/fixtures/test_fixture_yield_none' ], variables = variables )
297+ test_path = 'examples/fixtures/test_fixture_yield_none'
298+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
294299 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
295300
296301 start_count = mock_client .start_test_item .call_count
@@ -299,14 +304,15 @@ def test_fixture_yield_none(mock_client_init):
299304
300305 call_args = mock_client .start_test_item .call_args_list
301306 setup_call_args = call_args [1 ][0 ]
302- setup_step_name = 'function fixture setup: test_fixture_setup_yield_none'
307+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
308+ setup_step_name = f'function fixture setup: { fixture_name } '
303309 assert setup_call_args [0 ] == setup_step_name
304310
305311 setup_call_kwargs = call_args [1 ][1 ]
306312 assert not setup_call_kwargs ['has_stats' ]
307313
308314 teardown_call_args = call_args [- 1 ][0 ]
309- teardown_step_name = 'function fixture teardown: test_fixture_setup_yield_none '
315+ teardown_step_name = f 'function fixture teardown: { fixture_name } '
310316 assert teardown_call_args [0 ] == teardown_step_name
311317
312318 setup_call_kwargs = call_args [- 1 ][1 ]
@@ -334,7 +340,8 @@ def test_fixture_return_none(mock_client_init):
334340
335341 variables = dict (utils .DEFAULT_VARIABLES )
336342 variables ['rp_report_fixtures' ] = True
337- result = utils .run_pytest_tests (tests = ['examples/fixtures/test_fixture_return_none' ], variables = variables )
343+ test_path = 'examples/fixtures/test_fixture_return_none'
344+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
338345 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
339346
340347 start_count = mock_client .start_test_item .call_count
@@ -343,14 +350,15 @@ def test_fixture_return_none(mock_client_init):
343350
344351 call_args = mock_client .start_test_item .call_args_list
345352 setup_call_args = call_args [1 ][0 ]
346- setup_step_name = 'function fixture setup: test_fixture_setup_config_none'
353+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
354+ setup_step_name = f'function fixture setup: { fixture_name } '
347355 assert setup_call_args [0 ] == setup_step_name
348356
349357 setup_call_kwargs = call_args [1 ][1 ]
350358 assert not setup_call_kwargs ['has_stats' ]
351359
352360 teardown_call_args = call_args [- 1 ][0 ]
353- teardown_step_name = 'function fixture teardown: test_fixture_setup_config_none '
361+ teardown_step_name = f 'function fixture teardown: { fixture_name } '
354362 assert teardown_call_args [0 ] == teardown_step_name
355363
356364 setup_call_kwargs = call_args [- 1 ][1 ]
@@ -378,7 +386,8 @@ def test_failure_fixture_teardown(mock_client_init):
378386
379387 variables = dict (utils .DEFAULT_VARIABLES )
380388 variables ['rp_report_fixtures' ] = True
381- result = utils .run_pytest_tests (tests = ['examples/fixtures/test_failure_fixture_teardown' ], variables = variables )
389+ test_path = 'examples/fixtures/test_failure_fixture_teardown'
390+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
382391 assert int (result ) == 1 , 'Exit code should be 1 (test failure)'
383392
384393 start_count = mock_client .start_test_item .call_count
@@ -387,14 +396,15 @@ def test_failure_fixture_teardown(mock_client_init):
387396
388397 call_args = mock_client .start_test_item .call_args_list
389398 setup_call_args = call_args [1 ][0 ]
390- setup_step_name = 'function fixture setup: test_failure_fixture_teardown_config'
399+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
400+ setup_step_name = f'function fixture setup: { fixture_name } '
391401 assert setup_call_args [0 ] == setup_step_name
392402
393403 setup_call_kwargs = call_args [1 ][1 ]
394404 assert not setup_call_kwargs ['has_stats' ]
395405
396406 teardown_call_args = call_args [- 1 ][0 ]
397- teardown_step_name = 'function fixture teardown: test_failure_fixture_teardown_config '
407+ teardown_step_name = f 'function fixture teardown: { fixture_name } '
398408 assert teardown_call_args [0 ] == teardown_step_name
399409
400410 setup_call_kwargs = call_args [- 1 ][1 ]
@@ -435,7 +445,8 @@ def test_session_fixture_setup(mock_client_init):
435445
436446 variables = dict (utils .DEFAULT_VARIABLES )
437447 variables ['rp_report_fixtures' ] = True
438- result = utils .run_pytest_tests (tests = ['examples/fixtures/session_fixture_return' ], variables = variables )
448+ test_path = 'examples/fixtures/session_fixture_return'
449+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
439450 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
440451
441452 start_count = mock_client .start_test_item .call_count
@@ -444,14 +455,15 @@ def test_session_fixture_setup(mock_client_init):
444455
445456 call_args = mock_client .start_test_item .call_args_list
446457 setup_call_args = call_args [1 ][0 ]
447- step_name = 'session fixture setup: session_fixture_return_config'
458+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
459+ step_name = f'session fixture setup: { fixture_name } '
448460 assert setup_call_args [0 ] == step_name
449461
450462 setup_call_kwargs = call_args [1 ][1 ]
451463 assert not setup_call_kwargs ['has_stats' ]
452464
453465 teardown_call_args = call_args [- 1 ][0 ]
454- assert teardown_call_args [0 ] == 'session fixture teardown: session_fixture_return_config '
466+ assert teardown_call_args [0 ] == f 'session fixture teardown: { fixture_name } '
455467
456468 setup_call_kwargs = call_args [- 1 ][1 ]
457469 assert not setup_call_kwargs ['has_stats' ]
@@ -465,7 +477,8 @@ def test_package_fixture_setup(mock_client_init):
465477
466478 variables = dict (utils .DEFAULT_VARIABLES )
467479 variables ['rp_report_fixtures' ] = True
468- result = utils .run_pytest_tests (tests = ['examples/fixtures/package_fixture_return' ], variables = variables )
480+ test_path = 'examples/fixtures/package_fixture_return'
481+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
469482 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
470483
471484 start_count = mock_client .start_test_item .call_count
@@ -474,14 +487,15 @@ def test_package_fixture_setup(mock_client_init):
474487
475488 call_args = mock_client .start_test_item .call_args_list
476489 setup_call_args = call_args [1 ][0 ]
477- step_name = 'package fixture setup: package_fixture_return_config'
490+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
491+ step_name = f'package fixture setup: { fixture_name } '
478492 assert setup_call_args [0 ] == step_name
479493
480494 setup_call_kwargs = call_args [1 ][1 ]
481495 assert not setup_call_kwargs ['has_stats' ]
482496
483497 teardown_call_args = call_args [- 1 ][0 ]
484- assert teardown_call_args [0 ] == 'package fixture teardown: package_fixture_return_config '
498+ assert teardown_call_args [0 ] == f 'package fixture teardown: { fixture_name } '
485499
486500 setup_call_kwargs = call_args [- 1 ][1 ]
487501 assert not setup_call_kwargs ['has_stats' ]
@@ -495,7 +509,8 @@ def test_module_fixture_setup(mock_client_init):
495509
496510 variables = dict (utils .DEFAULT_VARIABLES )
497511 variables ['rp_report_fixtures' ] = True
498- result = utils .run_pytest_tests (tests = ['examples/fixtures/module_fixture_return' ], variables = variables )
512+ test_path = 'examples/fixtures/module_fixture_return'
513+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
499514 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
500515
501516 start_count = mock_client .start_test_item .call_count
@@ -504,14 +519,15 @@ def test_module_fixture_setup(mock_client_init):
504519
505520 call_args = mock_client .start_test_item .call_args_list
506521 setup_call_args = call_args [1 ][0 ]
507- step_name = 'module fixture setup: module_fixture_return_config'
522+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
523+ step_name = f'module fixture setup: { fixture_name } '
508524 assert setup_call_args [0 ] == step_name
509525
510526 setup_call_kwargs = call_args [1 ][1 ]
511527 assert not setup_call_kwargs ['has_stats' ]
512528
513529 teardown_call_args = call_args [- 1 ][0 ]
514- assert teardown_call_args [0 ] == 'module fixture teardown: module_fixture_return_config '
530+ assert teardown_call_args [0 ] == f 'module fixture teardown: { fixture_name } '
515531
516532 setup_call_kwargs = call_args [- 1 ][1 ]
517533 assert not setup_call_kwargs ['has_stats' ]
@@ -525,7 +541,8 @@ def test_class_fixture_setup(mock_client_init):
525541
526542 variables = dict (utils .DEFAULT_VARIABLES )
527543 variables ['rp_report_fixtures' ] = True
528- result = utils .run_pytest_tests (tests = ['examples/fixtures/class_fixture_return' ], variables = variables )
544+ test_path = 'examples/fixtures/class_fixture_return'
545+ result = utils .run_pytest_tests (tests = [test_path ], variables = variables )
529546 assert int (result ) == 0 , 'Exit code should be 0 (no errors)'
530547
531548 start_count = mock_client .start_test_item .call_count
@@ -534,7 +551,8 @@ def test_class_fixture_setup(mock_client_init):
534551
535552 call_args = mock_client .start_test_item .call_args_list
536553 setup_call_args = call_args [1 ][0 ]
537- step_name = 'class fixture setup: class_fixture_return_config'
554+ fixture_name = f'{ test_path .split ("/" )[- 1 ]} _config'
555+ step_name = f'class fixture setup: { fixture_name } '
538556 assert setup_call_args [0 ] == step_name
539557 setup_call_kwargs = call_args [1 ][1 ]
540558 assert not setup_call_kwargs ['has_stats' ]
@@ -544,7 +562,7 @@ def test_class_fixture_setup(mock_client_init):
544562 setup_call_kwargs = call_args [- 3 ][1 ]
545563 assert not setup_call_kwargs ['has_stats' ]
546564
547- teardown_step_name = 'class fixture teardown: class_fixture_return_config '
565+ teardown_step_name = f 'class fixture teardown: { fixture_name } '
548566 teardown_call_args = call_args [- 5 ][0 ]
549567 assert teardown_call_args [0 ] == teardown_step_name
550568 setup_call_kwargs = call_args [- 5 ][1 ]
0 commit comments