Fix pytest_status workaround if .cache is missing
This commit is contained in:
parent
2d9cf5ed3a
commit
8e2d315807
@ -170,7 +170,14 @@ def pytest_sessionfinish(exitstatus):
|
||||
"""Create a file to tell run_pytest.py how pytest exited."""
|
||||
outcome = yield
|
||||
outcome.get_result()
|
||||
status_file = os.path.join(os.path.abspath(os.path.dirname(__file__)),
|
||||
'..', '.cache', 'pytest_status')
|
||||
|
||||
cache_dir = os.path.join(os.path.abspath(os.path.dirname(__file__)),
|
||||
'..', '.cache')
|
||||
try:
|
||||
os.mkdir(cache_dir)
|
||||
except FileExistsError:
|
||||
pass
|
||||
|
||||
status_file = os.path.join(cache_dir, 'pytest_status')
|
||||
with open(status_file, 'w', encoding='ascii') as f:
|
||||
f.write(str(exitstatus))
|
||||
|
Loading…
Reference in New Issue
Block a user