mirror of
https://github.com/jrnl-org/jrnl.git
synced 2025-05-12 17:38:32 +02:00
Split "we use the config" and "we use no config" so pytest won't try to consume config_file as a fixture
This commit is contained in:
parent
931707b8ef
commit
5af1050d9d
1 changed files with 6 additions and 6 deletions
|
@ -83,16 +83,16 @@ def we_have_type_of_keyring(keyring_type):
|
||||||
return TestKeyring()
|
return TestKeyring()
|
||||||
|
|
||||||
|
|
||||||
@given(parse('we use the config "{config_file}"'), target_fixture="config_path")
|
|
||||||
@given(parse("we use no config"), target_fixture="config_path")
|
@given(parse("we use no config"), target_fixture="config_path")
|
||||||
def we_use_the_config(request, temp_dir, working_dir, config_file):
|
def we_use_no_config(temp_dir):
|
||||||
|
os.chdir(temp_dir.name) # @todo move this step to a more universal place
|
||||||
# Move into temp dir as cwd
|
|
||||||
os.chdir(temp_dir.name)
|
|
||||||
|
|
||||||
if not config_file:
|
|
||||||
return os.path.join(temp_dir.name, "non_existing_config.yaml")
|
return os.path.join(temp_dir.name, "non_existing_config.yaml")
|
||||||
|
|
||||||
|
@given(parse('we use the config "{config_file}"'), target_fixture="config_path")
|
||||||
|
def we_use_the_config(request, temp_dir, working_dir, config_file):
|
||||||
|
# Move into temp dir as cwd
|
||||||
|
os.chdir(temp_dir.name) # @todo move this step to a more universal place
|
||||||
|
|
||||||
# Copy the config file over
|
# Copy the config file over
|
||||||
config_source = os.path.join(working_dir, "data", "configs", config_file)
|
config_source = os.path.join(working_dir, "data", "configs", config_file)
|
||||||
config_dest = os.path.join(temp_dir.name, config_file)
|
config_dest = os.path.join(temp_dir.name, config_file)
|
||||||
|
|
Loading…
Add table
Reference in a new issue