Skip to content

Commit

Permalink
Remove pytest-mock dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
replaceafill committed Oct 25, 2024
1 parent f91baa8 commit d392b17
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions requirements-dev.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
pip-tools
pytest-cov
pytest-django
pytest-mock
pytest-playwright
pytest-randomly
pytest
Expand All @@ -15,5 +14,6 @@ tox
# See https://github.com/microsoft/playwright-python/issues/2190
git+https://github.com/microsoft/playwright-python.git@d9cdfbb1e178b6770625e9f857139aff77516af0#egg=playwright

# coverage 7.6.2 dropped support for Python 3.8, so pinning it for now.
# These dependencies dropped support for Python 3.8, so pinning them for now.
coverage==7.6.1
pytest-randomly==3.15.0
9 changes: 3 additions & 6 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ asgiref==3.8.1
# django
bagit==1.8.1
# via -r requirements.txt
boto3==1.35.45
boto3==1.35.48
# via -r requirements.txt
botocore==1.35.45
botocore==1.35.48
# via
# -r requirements.txt
# boto3
Expand Down Expand Up @@ -258,7 +258,6 @@ pytest==8.3.3
# pytest-base-url
# pytest-cov
# pytest-django
# pytest-mock
# pytest-playwright
# pytest-randomly
pytest-base-url==2.1.0
Expand All @@ -267,8 +266,6 @@ pytest-cov==5.0.0
# via -r requirements-dev.in
pytest-django==4.9.0
# via -r requirements-dev.in
pytest-mock==3.14.0
# via -r requirements-dev.in
pytest-playwright==0.5.2
# via -r requirements-dev.in
pytest-randomly==3.15.0
Expand Down Expand Up @@ -387,7 +384,7 @@ zope-event==5.0
# via
# -r requirements.txt
# gevent
zope-interface==7.1.0
zope-interface==7.1.1
# via
# -r requirements.txt
# gevent
Expand Down
4 changes: 2 additions & 2 deletions requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ brotli
Django>=4.2,<5
django-csp
django-tastypie
dj-database-url
gunicorn
importlib_resources
jsonfield
Expand All @@ -31,7 +30,8 @@ django-cas-ng
# Required for OpenID Connect authentication
mozilla-django-oidc

# gevent 24.10.1 dropped support for Python 3.8, so pinning it for now.
# These dependencies dropped support for Python 3.8, so pinning them for now.
dj-database-url==2.2.0
django-auth-ldap==5.0.0
gevent==24.2.1
pyparsing==3.1.4
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ asgiref==3.8.1
# via django
bagit==1.8.1
# via -r requirements.in
boto3==1.35.45
boto3==1.35.48
# via -r requirements.in
botocore==1.35.45
botocore==1.35.48
# via
# boto3
# s3transfer
Expand Down Expand Up @@ -219,7 +219,7 @@ zipp==3.20.2
# via importlib-resources
zope-event==5.0
# via gevent
zope-interface==7.1.0
zope-interface==7.1.1
# via gevent

# The following packages are considered to be unsafe in a requirements file:
Expand Down
7 changes: 5 additions & 2 deletions tests/common/conftest.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
from unittest import mock

import pytest


@pytest.fixture(autouse=True)
def do_not_reset_the_root_logger(mocker):
def do_not_reset_the_root_logger():
# Some management commands suppress logging from models/package.py
# by calling logging.config.dictConfig directly which breaks the caplog
# fixture. See https://github.com/pytest-dev/pytest/discussions/11011
#
# This avoids breaking the caplog fixture when those management command
# modules are imported or called during tests.
mocker.patch("logging.config")
with mock.patch("logging.config"):
yield

0 comments on commit d392b17

Please sign in to comment.