Skip to content

Commit 64df833

Browse files
committed
Split tests for ini vs toml
1 parent 94dfc09 commit 64df833

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

tests/agent_features/test_configuration.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1063,7 +1063,27 @@ def test_toml_parse_production():
10631063
@pytest.mark.parametrize(
10641064
"pathtype", [str, lambda s: s.encode("utf-8"), pathlib.Path], ids=["str", "bytes", "pathlib.Path"]
10651065
)
1066-
def test_config_file_path_types(pathtype):
1066+
def test_config_file_path_types_ini(pathtype):
1067+
settings = global_settings()
1068+
_reset_configuration_done()
1069+
_reset_config_parser()
1070+
_reset_instrumentation_done()
1071+
1072+
with tempfile.NamedTemporaryFile(suffix=".ini") as f:
1073+
f.write(newrelic_ini_contents)
1074+
f.seek(0)
1075+
1076+
config_file = pathtype(f.name)
1077+
initialize(config_file=config_file)
1078+
value = fetch_config_setting(settings, "app_name")
1079+
assert value == "Python Agent Test (agent_features)"
1080+
1081+
1082+
@pytest.mark.parametrize(
1083+
"pathtype", [str, lambda s: s.encode("utf-8"), pathlib.Path], ids=["str", "bytes", "pathlib.Path"]
1084+
)
1085+
@SKIP_IF_NOT_PY311
1086+
def test_config_file_path_types_toml(pathtype):
10671087
settings = global_settings()
10681088
_reset_configuration_done()
10691089
_reset_config_parser()

0 commit comments

Comments
 (0)