Create journal with absolute path when no path is specified (#972)

* create jrnl with abspath

Co-authored-by: = <esrh@netc.eu>
This commit is contained in:
eshrh 2020-06-13 14:08:22 -04:00 committed by GitHub
parent d9951b54c0
commit 2a3fd820b9
4 changed files with 21 additions and 2 deletions

View file

@ -2,6 +2,8 @@ import os
import shutil
import sys
CWD = os.getcwd()
def clean_all_working_dirs():
for folder in ("configs", "journals", "cache"):
@ -26,7 +28,6 @@ def before_scenario(context, scenario):
"""Before each scenario, backup all config and journal test data."""
# Clean up in case something went wrong
clean_all_working_dirs()
for folder in ("configs", "journals"):
original = os.path.join("features", "data", folder)
working_dir = os.path.join("features", folder)
@ -52,4 +53,6 @@ def before_scenario(context, scenario):
def after_scenario(context, scenario):
"""After each scenario, restore all test data and remove working_dirs."""
if os.getcwd() != CWD:
os.chdir(CWD)
clean_all_working_dirs()