Skip to content

Commit 4e233bf

Browse files
authored
Fix native toml documentation does not match code (#60)
1 parent 81a2692 commit 4e233bf

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.pre-commit-config.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ repos:
55
- id: end-of-file-fixer
66
- id: trailing-whitespace
77
- repo: https://github.com/astral-sh/ruff-pre-commit
8-
rev: "v0.1.1"
8+
rev: "v0.1.3"
99
hooks:
1010
- id: ruff
1111
args: [--fix, --exit-non-zero-on-fix]
@@ -19,7 +19,7 @@ repos:
1919
- id: tox-ini-fmt
2020
args: ["-p", "fix"]
2121
- repo: https://github.com/tox-dev/pyproject-fmt
22-
rev: "1.2.0"
22+
rev: "1.3.0"
2323
hooks:
2424
- id: pyproject-fmt
2525
additional_dependencies: ["tox>=4.11.3"]

pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ dynamic = [
3535
"version",
3636
]
3737
dependencies = [
38-
"pytest>=7.4.2",
38+
"pytest>=7.4.3",
3939
'tomli>=2.0.1; python_version < "3.11"',
4040
]
4141
optional-dependencies.test = [

src/pytest_env/plugin.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ def _load_values(early_config: pytest.Config) -> Iterator[Entry]:
5454
config = tomllib.load(file_handler)
5555
if "tool" in config and "pytest_env" in config["tool"]:
5656
has_toml_conf = True
57-
for key, entry in config["tool"]["pytest_env"].get("env", {}).items():
57+
for key, entry in config["tool"]["pytest_env"].items():
5858
if isinstance(entry, dict):
5959
value = str(entry["value"])
6060
transform, skip_if_set = bool(entry.get("transform")), bool(entry.get("skip_if_set"))

tests/test_env.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -137,21 +137,21 @@ def test_env_via_pytest(
137137
),
138138
pytest.param(
139139
{},
140-
'[tool.pytest_env.env]\nMAGIC = 1\nMAGIC_2 = "toml2"',
140+
'[tool.pytest_env]\nMAGIC = 1\nMAGIC_2 = "toml2"',
141141
"",
142142
{"MAGIC": "1", "MAGIC_2": "toml2"},
143143
id="toml native",
144144
),
145145
pytest.param(
146146
{},
147-
'[tool.pytest_env.env]\nMAGIC = 1\nMAGIC_2 = "toml2"',
147+
'[tool.pytest_env]\nMAGIC = 1\nMAGIC_2 = "toml2"',
148148
"[pytest]\nenv = MAGIC=ini\n MAGIC_2=ini2",
149149
{"MAGIC": "1", "MAGIC_2": "toml2"},
150150
id="toml native over ini",
151151
),
152152
pytest.param(
153153
{},
154-
'[tool.pytest_env.env]\nMAGIC = {value = "toml", "transform"= true, "skip_if_set" = true}',
154+
'[tool.pytest_env]\nMAGIC = {value = "toml", "transform"= true, "skip_if_set" = true}',
155155
"",
156156
{"MAGIC": "toml"},
157157
id="toml inline table",

0 commit comments

Comments
 (0)