Skip to content

Commit cb4d567

Browse files
committed
Drop Python 3.6, add support for 3.10
1 parent 0b869db commit cb4d567

File tree

6 files changed

+17
-11
lines changed

6 files changed

+17
-11
lines changed

.github/workflows/main.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,17 +10,17 @@ jobs:
1010
strategy:
1111
fail-fast: false
1212
matrix:
13-
python: ["3.6", "3.7", "3.8", "3.9"]
13+
python: ["3.7", "3.8", "3.9", "3.10"]
1414
os: [ubuntu-latest, windows-latest]
1515
include:
16-
- python: "3.6"
17-
tox_env: "py36"
1816
- python: "3.7"
1917
tox_env: "py37"
2018
- python: "3.8"
2119
tox_env: "py38"
2220
- python: "3.9"
2321
tox_env: "py39"
22+
- python: "3.10"
23+
tox_env: "py310"
2424

2525
steps:
2626
- uses: actions/checkout@v1

CHANGELOG.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
3.7.0 (UNRELEASED)
2+
------------------
3+
4+
* Python 3.10 now officially supported.
5+
* Dropped support for Python 3.6.
6+
17
3.6.1 (2021-05-06)
28
------------------
39

File renamed without changes.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
package_data={
1313
"pytest_mock": ["py.typed"],
1414
},
15-
python_requires=">=3.6",
15+
python_requires=">=3.7",
1616
install_requires=["pytest>=5.0"],
1717
use_scm_version={"write_to": "src/pytest_mock/_version.py"},
1818
setup_requires=["setuptools_scm"],
@@ -31,10 +31,10 @@
3131
"License :: OSI Approved :: MIT License",
3232
"Operating System :: OS Independent",
3333
"Programming Language :: Python :: 3",
34-
"Programming Language :: Python :: 3.6",
3534
"Programming Language :: Python :: 3.7",
3635
"Programming Language :: Python :: 3.8",
3736
"Programming Language :: Python :: 3.9",
37+
"Programming Language :: Python :: 3.10",
3838
"Programming Language :: Python :: 3 :: Only",
3939
"Topic :: Software Development :: Testing",
4040
],

tests/test_pytest_mock.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def test_repr_with_no_name(self, mocker: MockerFixture) -> None:
211211
def test_repr_with_name(self, mocker: MockerFixture) -> None:
212212
test_name = "funny walk"
213213
stub = mocker.stub(name=test_name)
214-
assert "name={!r}".format(test_name) in repr(stub)
214+
assert f"name={test_name!r}" in repr(stub)
215215

216216
def __test_failure_message(self, mocker: MockerFixture, **kwargs: Any) -> None:
217217
expected_name = kwargs.get("name") or "mock"
@@ -267,19 +267,19 @@ def test_instance_method_spy_exception(
267267
) -> None:
268268
class Foo:
269269
def bar(self, arg):
270-
raise exc_cls("Error with {}".format(arg))
270+
raise exc_cls(f"Error with {arg}")
271271

272272
foo = Foo()
273273
spy = mocker.spy(foo, "bar")
274274

275275
expected_calls = []
276276
for i, v in enumerate([10, 20]):
277-
with pytest.raises(exc_cls, match="Error with {}".format(v)):
277+
with pytest.raises(exc_cls, match=f"Error with {v}"):
278278
foo.bar(arg=v)
279279

280280
expected_calls.append(mocker.call(arg=v))
281281
assert foo.bar.call_args_list == expected_calls # type:ignore[attr-defined]
282-
assert str(spy.spy_exception) == "Error with {}".format(v)
282+
assert str(spy.spy_exception) == f"Error with {v}"
283283

284284

285285
def test_instance_method_spy_autospec_true(mocker: MockerFixture) -> None:
@@ -296,7 +296,7 @@ def bar(self, arg):
296296

297297

298298
def test_spy_reset(mocker: MockerFixture) -> None:
299-
class Foo(object):
299+
class Foo:
300300
def bar(self, x):
301301
if x == 0:
302302
raise ValueError("invalid x")

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
minversion = 3.5.3
3-
envlist = py{35,36,37,38,39}, linting, norewrite
3+
envlist = py{37,38,39,310}, linting, norewrite
44

55
[testenv]
66
passenv = USER USERNAME

0 commit comments

Comments
 (0)