diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f8840c0..6969d9d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,17 +10,17 @@ jobs: strategy: fail-fast: false matrix: - python: ["3.6", "3.7", "3.8", "3.9"] + python: ["3.7", "3.8", "3.9", "3.10"] os: [ubuntu-latest, windows-latest] include: - - python: "3.6" - tox_env: "py36" - python: "3.7" tox_env: "py37" - python: "3.8" tox_env: "py38" - python: "3.9" tox_env: "py39" + - python: "3.10" + tox_env: "py310" steps: - uses: actions/checkout@v1 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0f88309..6e1eafd 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,3 +1,9 @@ +3.7.0 (UNRELEASED) +------------------ + +* Python 3.10 now officially supported. +* Dropped support for Python 3.6. + 3.6.1 (2021-05-06) ------------------ diff --git a/HOWTORELEASE.rst b/RELEASING.rst similarity index 100% rename from HOWTORELEASE.rst rename to RELEASING.rst diff --git a/setup.py b/setup.py index 96db74f..7de0ab4 100644 --- a/setup.py +++ b/setup.py @@ -12,7 +12,7 @@ package_data={ "pytest_mock": ["py.typed"], }, - python_requires=">=3.6", + python_requires=">=3.7", install_requires=["pytest>=5.0"], use_scm_version={"write_to": "src/pytest_mock/_version.py"}, setup_requires=["setuptools_scm"], @@ -31,10 +31,10 @@ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", + "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3 :: Only", "Topic :: Software Development :: Testing", ], diff --git a/tests/test_pytest_mock.py b/tests/test_pytest_mock.py index da20cf6..cca50ad 100644 --- a/tests/test_pytest_mock.py +++ b/tests/test_pytest_mock.py @@ -211,7 +211,7 @@ def test_repr_with_no_name(self, mocker: MockerFixture) -> None: def test_repr_with_name(self, mocker: MockerFixture) -> None: test_name = "funny walk" stub = mocker.stub(name=test_name) - assert "name={!r}".format(test_name) in repr(stub) + assert f"name={test_name!r}" in repr(stub) def __test_failure_message(self, mocker: MockerFixture, **kwargs: Any) -> None: expected_name = kwargs.get("name") or "mock" @@ -267,19 +267,19 @@ def test_instance_method_spy_exception( ) -> None: class Foo: def bar(self, arg): - raise exc_cls("Error with {}".format(arg)) + raise exc_cls(f"Error with {arg}") foo = Foo() spy = mocker.spy(foo, "bar") expected_calls = [] for i, v in enumerate([10, 20]): - with pytest.raises(exc_cls, match="Error with {}".format(v)): + with pytest.raises(exc_cls, match=f"Error with {v}"): foo.bar(arg=v) expected_calls.append(mocker.call(arg=v)) assert foo.bar.call_args_list == expected_calls # type:ignore[attr-defined] - assert str(spy.spy_exception) == "Error with {}".format(v) + assert str(spy.spy_exception) == f"Error with {v}" def test_instance_method_spy_autospec_true(mocker: MockerFixture) -> None: @@ -296,7 +296,7 @@ def bar(self, arg): def test_spy_reset(mocker: MockerFixture) -> None: - class Foo(object): + class Foo: def bar(self, x): if x == 0: raise ValueError("invalid x") diff --git a/tox.ini b/tox.ini index 784f892..2af93bf 100644 --- a/tox.ini +++ b/tox.ini @@ -1,6 +1,6 @@ [tox] minversion = 3.5.3 -envlist = py{35,36,37,38,39}, linting, norewrite +envlist = py{37,38,39,310}, linting, norewrite [testenv] passenv = USER USERNAME