Skip to content

Commit e05e7a6

Browse files
authored
chore: use pytest's new strict mode and fix duplicate tests (#10847)
1 parent 6630816 commit e05e7a6

5 files changed

Lines changed: 11 additions & 42 deletions

File tree

poetry.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ coverage = ">=7.2.0"
7474
deepdiff = ">=6.3"
7575
responses = ">=0.25.8"
7676
jaraco-classes = ">=3.3.1"
77-
pytest = ">=8.0"
77+
pytest = ">=9.0"
7878
pytest-cov = ">=4.0"
7979
pytest-mock = ">=3.9"
8080
pytest-randomly = ">=3.12"
@@ -187,15 +187,15 @@ module = [
187187
ignore_missing_imports = true
188188

189189

190-
[tool.pytest.ini_options]
191-
addopts = [ "-n", "logical", "-ra", "--strict-config", "--strict-markers" ]
190+
[tool.pytest]
191+
strict = true
192+
addopts = [ "-n", "logical", "-ra" ]
192193
testpaths = ["tests"]
193194
markers = [
194195
"network: mark tests that require internet access",
195-
"skip_git_mock: mark tests that should not auto-apply git_mock"
196+
"skip_git_mock: mark tests that should not auto-apply git_mock",
196197
]
197198
log_cli_level = "INFO"
198-
xfail_strict = true
199199

200200

201201
[tool.coverage.report]

tests/console/commands/test_show.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -394,37 +394,6 @@ def _configure_project_with_groups(poetry: Poetry, installed: Repository) -> Non
394394
},
395395
],
396396
),
397-
(
398-
"--with time",
399-
"""\
400-
cachy 0.1.0 Cachy package
401-
pendulum 2.0.0 Pendulum package
402-
pytest 3.7.3 Pytest package
403-
""",
404-
),
405-
(
406-
"--with time --format json",
407-
[
408-
{
409-
"name": "cachy",
410-
"version": "0.1.0",
411-
"description": "Cachy package",
412-
"installed_status": "installed",
413-
},
414-
{
415-
"name": "pendulum",
416-
"version": "2.0.0",
417-
"description": "Pendulum package",
418-
"installed_status": "installed",
419-
},
420-
{
421-
"name": "pytest",
422-
"version": "3.7.3",
423-
"description": "Pytest package",
424-
"installed_status": "installed",
425-
},
426-
],
427-
),
428397
],
429398
)
430399
def test_show_basic_with_group_options(

tests/packages/test_locker.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ def test_is_fresh(
9090
("outdated", "2.3.0", False),
9191
("valid", "2.2.1", True),
9292
("legacy", "2.2.1", True),
93-
("outdated", "2.3.0", False),
93+
("outdated", "2.2.1", False),
9494
],
9595
)
9696
def test_is_fresh_dependency_groups(

tests/vcs/git/test_backend.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,10 @@ def test_get_name_from_source_url(url: str) -> None:
102102
assert name == "poetry"
103103

104104

105-
@pytest.mark.parametrize(("tag"), ["my-tag", b"my-tag"])
105+
@pytest.mark.parametrize("tag", ["my-tag", b"my-tag"], ids=["str", "bytes"])
106106
def test_peeled_tag(tag: str | bytes) -> None:
107-
tag = peeled_tag("my-tag")
108-
assert tag == b"my-tag^{}"
107+
tag_ref = peeled_tag(tag)
108+
assert tag_ref == b"my-tag^{}"
109109

110110

111111
def test_get_remote_url(repo_mock: Repo) -> None:

0 commit comments

Comments
 (0)