Skip to content

Commit

Permalink
Drop Python 3.5 support
Browse files Browse the repository at this point in the history
Also drop linting environment, as we are using pre-commit.ci
now.
  • Loading branch information
nicoddemus committed Apr 24, 2021
1 parent 3425616 commit 4716752
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 29 deletions.
24 changes: 2 additions & 22 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,9 @@ jobs:
strategy:
fail-fast: false
matrix:
python: ["3.5", "3.6", "3.7", "3.8", "3.9"]
python: ["3.6", "3.7", "3.8", "3.9"]
os: [ubuntu-latest, windows-latest]
include:
- python: "3.5"
tox_env: "py35"
- python: "3.6"
tox_env: "py36"
- python: "3.7"
Expand All @@ -38,31 +36,13 @@ jobs:
run: |
tox -e ${{ matrix.tox_env }}
linting:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up Python
uses: actions/setup-python@v1
with:
python-version: "3.7"
- name: Install tox
run: |
python -m pip install --upgrade pip
pip install tox
- name: Linting
run: |
tox -e linting
deploy:

if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags')

runs-on: ubuntu-latest

needs: [build, linting]
needs: build

steps:
- uses: actions/checkout@v1
Expand Down
8 changes: 7 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
3.5.2 (UNRELEASED)
3.6.0 (2021-04-24)
------------------

* pytest-mock no longer supports Python 3.5.

* Correct type annotations for ``mocker.patch.object`` to also include the string form.
Thanks `@plannigan`_ for the PR (`#235`_).

* ``reset_all`` now supports ``return_value`` and ``side_effect`` keyword arguments. Thanks `@alex-marty`_ for the PR (`#214`_).

.. _@alex-marty: https://github.com/alex-marty
.. _@plannigan: https://github.com/plannigan
.. _#214: https://github.com/pytest-dev/pytest-mock/pull/214
.. _#235: https://github.com/pytest-dev/pytest-mock/pull/235

3.5.1 (2021-01-10)
Expand Down
3 changes: 1 addition & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
package_data={
"pytest_mock": ["py.typed"],
},
python_requires=">=3.5",
python_requires=">=3.6",
install_requires=["pytest>=5.0"],
use_scm_version={"write_to": "src/pytest_mock/_version.py"},
setup_requires=["setuptools_scm"],
Expand All @@ -31,7 +31,6 @@
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
Expand Down
6 changes: 4 additions & 2 deletions src/pytest_mock/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,12 @@ def __init__(self, config: Any) -> None:
if hasattr(mock_module, "seal"):
self.seal = mock_module.seal

def resetall(self, *, return_value: bool = False, side_effect: bool = False) -> None:
def resetall(
self, *, return_value: bool = False, side_effect: bool = False
) -> None:
"""
Call reset_mock() on all patchers started by this fixture.
:param bool return_value: Reset the return_value of mocks.
:param bool side_effect: Reset the side_effect of mocks.
"""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_pytest_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,9 +191,9 @@ def test_mocker_resetall(mocker: MockerFixture) -> None:
assert not open.called
assert listdir.return_value == "foo"
assert list(open.side_effect) == ["baz"]

mocker.resetall(return_value=True, side_effect=True)

assert isinstance(listdir.return_value, mocker.Mock)
assert open.side_effect is None

Expand Down

0 comments on commit 4716752

Please sign in to comment.