Skip to content

Commit e43ab19

Browse files
authored
Merge pull request #407 from nicoddemus/pytest6-compatibility
Require pytest >=6.2.5
2 parents e6aad18 + 875f5aa commit e43ab19

File tree

5 files changed

+16
-7
lines changed

5 files changed

+16
-7
lines changed

.github/workflows/test.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,9 @@ jobs:
3535
os: [ubuntu-latest, windows-latest]
3636
tox_env: ["py"]
3737
include:
38+
- python: "3.10"
39+
os: ubuntu-latest
40+
tox_env: "pytest6"
3841
- python: "3.12"
3942
os: ubuntu-latest
4043
tox_env: "norewrite"

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Releases
22
========
33

4+
UNRELEASED
5+
----------
6+
7+
* ``pytest-mock`` now requires ``pytest>=6.2.5``.
8+
49
3.12.0 (2023-10-19)
510
-------------------
611

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"pytest_mock": ["py.typed"],
1212
},
1313
python_requires=">=3.8",
14-
install_requires=["pytest>=5.0"],
14+
install_requires=["pytest>=6.2.5"],
1515
use_scm_version={"write_to": "src/pytest_mock/_version.py"},
1616
setup_requires=["setuptools_scm"],
1717
url="https://github.com/pytest-dev/pytest-mock/",

tests/test_pytest_mock.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -559,7 +559,7 @@ def assert_argument_introspection(left: Any, right: Any) -> Generator[None, None
559559
# NOTE: we assert with either verbose or not, depending on how our own
560560
# test was run by examining sys.argv
561561
verbose = any(a.startswith("-v") for a in sys.argv)
562-
if int(pytest.version_tuple[0]) < 8:
562+
if int(pytest.__version__.split(".")[0]) < 8:
563563
expected = "\n ".join(util._compare_eq_iterable(left, right, verbose)) # type:ignore[arg-type]
564564
else:
565565
expected = "\n ".join(
@@ -888,12 +888,12 @@ def test(mocker):
888888
"*Args:",
889889
"*assert ('fo',) == ('',)",
890890
"*At index 0 diff: 'fo' != ''*",
891-
"*Use -v to get more diff*",
891+
"*Use -v to*",
892892
"*Kwargs:*",
893893
"*assert {} == {'bar': 4}*",
894894
"*Right contains* more item*",
895895
"*{'bar': 4}*",
896-
"*Use -v to get more diff*",
896+
"*Use -v to*",
897897
]
898898
result.stdout.fnmatch_lines(expected_lines)
899899

@@ -929,12 +929,12 @@ async def test(mocker):
929929
"*Args:",
930930
"*assert ('fo',) == ('',)",
931931
"*At index 0 diff: 'fo' != ''*",
932-
"*Use -v to get more diff*",
932+
"*Use -v to*",
933933
"*Kwargs:*",
934934
"*assert {} == {'bar': 4}*",
935935
"*Right contains* more item*",
936936
"*{'bar': 4}*",
937-
"*Use -v to get more diff*",
937+
"*Use -v to*",
938938
]
939939
result.stdout.fnmatch_lines(expected_lines)
940940

tox.ini

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
[tox]
22
minversion = 3.5.3
3-
envlist = py{38,39,310,311,312}, norewrite
3+
envlist = py{38,39,310,311,312}, norewrite, pytest6
44

55
[testenv]
66
deps =
77
coverage
88
mock
99
pytest-asyncio
10+
pytest6: pytest==6.2.5
1011
commands =
1112
coverage run --append --source={envsitepackagesdir}/pytest_mock -m pytest tests --color=yes
1213

0 commit comments

Comments
 (0)