File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -174,6 +174,9 @@ def pytest_runtest_logreport(report):
174
174
@pytest .fixture
175
175
def test_output_dir (results_dir , request ):
176
176
"""Create and return a test specific directory"""
177
+ if results_dir is None :
178
+ return None
179
+
177
180
raw_data_path = Path (results_dir / request .node .name )
178
181
if raw_data_path .is_dir ():
179
182
shutil .rmtree (raw_data_path )
@@ -198,7 +201,8 @@ def metrics(test_output_dir, request):
198
201
metrics_logger .set_property (prop_name , prop_val )
199
202
yield metrics_logger
200
203
metrics_logger .flush ()
201
- metrics_logger .store_data (test_output_dir )
204
+ if test_output_dir :
205
+ metrics_logger .store_data (test_output_dir )
202
206
203
207
204
208
@pytest .fixture
@@ -407,12 +411,17 @@ def results_dir(request):
407
411
408
412
For example
409
413
```py
410
- def test_my_file(results_dir ):
414
+ def test_my_file(reggsults_dir ):
411
415
(results_dir / "output.txt").write_text("Hello World")
412
416
```
413
417
will result in `defs.TEST_RESULTS_DIR`/test_my_file/output.txt.
418
+
419
+ Because this fixture is
414
420
"""
415
- results_dir = defs .TEST_RESULTS_DIR / request .node .originalname
421
+ try :
422
+ results_dir = defs .TEST_RESULTS_DIR / request .node .originalname
423
+ except AttributeError :
424
+ return None
416
425
results_dir .mkdir (parents = True , exist_ok = True )
417
426
return results_dir
418
427
You can’t perform that action at this time.
0 commit comments