Repro: Try to run some tests with parameter --json-report-file and save result to directory which does not exists, e.g "results/report.json".
Traceback (most recent call last):
File "C:\Program Files\Python37-32\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "C:\Program Files\Python37-32\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Program Files\Python37-32\lib\site-packages\pytest.py", line 102, in
raise SystemExit(pytest.main())
File "C:\Program Files\Python37-32\lib\site-packages_pytest\config__init.py", line 82, in main
return config.hook.pytest_cmdline_main(config=config)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\hooks.py", line 289, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\manager.py", line 87, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\manager.py", line 81, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 208, in _multicall
return outcome.get_result()
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "C:\Program Files\Python37-32\lib\site-packages_pytest\main.py", line 243, in pytest_cmdline_main
return wrap_session(config, _main)
File "C:\Program Files\Python37-32\lib\site-packages_pytest\main.py", line 236, in wrap_session
session=session, exitstatus=session.exitstatus
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\hooks.py", line 289, in call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\manager.py", line 87, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\manager.py", line 81, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 203, in _multicall
gen.send(outcome)
File "C:\Program Files\Python37-32\lib\site-packages_pytest\terminal.py", line 662, in pytest_sessionfinish
outcome.get_result()
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "C:\Program Files\Python37-32\lib\site-packages\pytest_jsonreport\plugin.py", line 191, in pytest_sessionfinish
self.save_report(path)
File "C:\Program Files\Python37-32\lib\site-packages\pytest_jsonreport\plugin.py", line 201, in save_report
with open(path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\jenkins\workspace\ZAWorkflow\TESTS\results\tests-za-09_Win10_19H1_x86-4383.json'
Python: 3.7.3 Pytest: 4.6.3 pytest-json-report: 1.0.4
Repro: Try to run some tests with parameter --json-report-file and save result to directory which does not exists, e.g "results/report.json".
Traceback (most recent call last): File "C:\Program Files\Python37-32\lib\runpy.py", line 193, in _run_module_as_main "main", mod_spec) File "C:\Program Files\Python37-32\lib\runpy.py", line 85, in _run_code exec(code, run_globals) File "C:\Program Files\Python37-32\lib\site-packages\pytest.py", line 102, in
raise SystemExit(pytest.main())
File "C:\Program Files\Python37-32\lib\site-packages_pytest\config__init.py", line 82, in main
return config.hook.pytest_cmdline_main(config=config)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\hooks.py", line 289, in call
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\manager.py", line 87, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\manager.py", line 81, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 208, in _multicall
return outcome.get_result()
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "C:\Program Files\Python37-32\lib\site-packages_pytest\main.py", line 243, in pytest_cmdline_main
return wrap_session(config, _main)
File "C:\Program Files\Python37-32\lib\site-packages_pytest\main.py", line 236, in wrap_session
session=session, exitstatus=session.exitstatus
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\hooks.py", line 289, in call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\manager.py", line 87, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\manager.py", line 81, in
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 203, in _multicall
gen.send(outcome)
File "C:\Program Files\Python37-32\lib\site-packages_pytest\terminal.py", line 662, in pytest_sessionfinish
outcome.get_result()
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 80, in get_result
raise ex[1].with_traceback(ex[2])
File "C:\Program Files\Python37-32\lib\site-packages\pluggy\callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "C:\Program Files\Python37-32\lib\site-packages\pytest_jsonreport\plugin.py", line 191, in pytest_sessionfinish
self.save_report(path)
File "C:\Program Files\Python37-32\lib\site-packages\pytest_jsonreport\plugin.py", line 201, in save_report
with open(path, 'w') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'c:\jenkins\workspace\ZAWorkflow\TESTS\results\tests-za-09_Win10_19H1_x86-4383.json'