From d392b17bf5b8eeea532b41bfe428b2b9bf1f0e67 Mon Sep 17 00:00:00 2001 From: "Douglas Cerna (Soy Douglas)" Date: Fri, 25 Oct 2024 17:06:34 +0000 Subject: [PATCH] Remove pytest-mock dependency --- requirements-dev.in | 4 ++-- requirements-dev.txt | 9 +++------ requirements.in | 4 ++-- requirements.txt | 6 +++--- tests/common/conftest.py | 7 +++++-- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/requirements-dev.in b/requirements-dev.in index ceecf7a3b..699b7fa50 100644 --- a/requirements-dev.in +++ b/requirements-dev.in @@ -4,7 +4,6 @@ pip-tools pytest-cov pytest-django -pytest-mock pytest-playwright pytest-randomly pytest @@ -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 diff --git a/requirements-dev.txt b/requirements-dev.txt index ba7298580..59f8492f2 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/requirements.in b/requirements.in index c1ce1481a..ce3439f5c 100644 --- a/requirements.in +++ b/requirements.in @@ -5,7 +5,6 @@ brotli Django>=4.2,<5 django-csp django-tastypie -dj-database-url gunicorn importlib_resources jsonfield @@ -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 diff --git a/requirements.txt b/requirements.txt index 2f5871968..da4659a96 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 @@ -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: diff --git a/tests/common/conftest.py b/tests/common/conftest.py index 7cf1f6129..4bdbbe135 100644 --- a/tests/common/conftest.py +++ b/tests/common/conftest.py @@ -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