Refactor naming in configuration fixtures

This commit is contained in:
Roman Mogylatov 2022-07-06 23:22:57 -04:00
parent df8f1f10a9
commit a7ca9e08ae

View File

@ -52,14 +52,14 @@ def ini_config_file_2(tmp_path):
@fixture @fixture
def ini_config_file_3(tmp_path): def ini_config_file_3(tmp_path):
ini_config_file_3 = str(tmp_path / "config_3.ini") config_file = str(tmp_path / "config_3.ini")
with open(ini_config_file_3, "w") as file: with open(config_file, "w") as file:
file.write( file.write(
"[section1]\n" "[section1]\n"
"value1=${CONFIG_TEST_ENV}\n" "value1=${CONFIG_TEST_ENV}\n"
"value2=${CONFIG_TEST_PATH}/path\n" "value2=${CONFIG_TEST_PATH}/path\n"
) )
return ini_config_file_3 return config_file
@fixture @fixture
@ -92,14 +92,14 @@ def yaml_config_file_2(tmp_path):
@fixture @fixture
def yaml_config_file_3(tmp_path): def yaml_config_file_3(tmp_path):
yaml_config_file_3 = str(tmp_path / "config_3.yml") config_file = str(tmp_path / "config_3.yml")
with open(yaml_config_file_3, "w") as file: with open(config_file, "w") as file:
file.write( file.write(
"section1:\n" "section1:\n"
" value1: ${CONFIG_TEST_ENV}\n" " value1: ${CONFIG_TEST_ENV}\n"
" value2: ${CONFIG_TEST_PATH}/path\n" " value2: ${CONFIG_TEST_PATH}/path\n"
) )
return yaml_config_file_3 return config_file
@fixture @fixture
@ -143,8 +143,8 @@ def json_config_file_2(tmp_path):
@fixture @fixture
def json_config_file_3(tmp_path): def json_config_file_3(tmp_path):
yaml_config_file_3 = str(tmp_path / "config_3.json") config_file = str(tmp_path / "config_3.json")
with open(yaml_config_file_3, "w") as file: with open(config_file, "w") as file:
file.write( file.write(
json.dumps( json.dumps(
{ {
@ -155,7 +155,7 @@ def json_config_file_3(tmp_path):
}, },
), ),
) )
return yaml_config_file_3 return config_file
@fixture(autouse=True) @fixture(autouse=True)