Skip to content

Commit

Permalink
Changing string split
Browse files Browse the repository at this point in the history
  • Loading branch information
casabre committed May 13, 2024
1 parent 6b14c5d commit 928de67
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/usage/stage_settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ def test_base():

Custom settings for each supported stage can be easily setup. You have to create a file with
a `.json` or `.yaml` extension and call pytest with this additional parameter `--stage-settings`.
It's also possible to inject a serialized string with the following prefix `--stage-settings json;{...}`.

The file will be validated against a schema of supported values and in case of an error, a `jsonschema.ValidationError`
will be thrown.
Expand Down
2 changes: 1 addition & 1 deletion src/pytest_fluent/setting_file_loader_action.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def load_and_check_settings_file(file_name: str) -> typing.Dict[str, typing.Any]
typing.Dict[str, typing.Any]: User settings dictionary.
"""
splitted = re.split(
r":",
r";",
file_name,
maxsplit=1,
flags=re.IGNORECASE | re.MULTILINE,
Expand Down
4 changes: 2 additions & 2 deletions tests/test_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ def test_more_complex_json_string(complex):
args = parser.parse_args(
[
"--stage-settings",
f"json:{json.dumps(complex, indent=0)}",
f"json;{json.dumps(complex, indent=0)}",
]
)
assert args.settings == complex
Expand All @@ -93,7 +93,7 @@ def test_more_complex_yaml_string(complex):
args = parser.parse_args(
[
"--stage-settings",
f"yaml:{io.getvalue()}",
f"yaml;{io.getvalue()}",
]
)
assert args.settings == complex
Expand Down

0 comments on commit 928de67

Please sign in to comment.