From 445a799527d9d1893d9cfef8e666bc8dc1a949c2 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Thu, 12 Sep 2024 20:05:12 +0000 Subject: [PATCH 1/2] Update dependency pytest to v8 --- poetry.lock | 14 +++++++------- pyproject.toml | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/poetry.lock b/poetry.lock index a375a0e2f4..4ef51d3b38 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3165,23 +3165,23 @@ files = [ [[package]] name = "pytest" -version = "7.4.4" +version = "8.3.3" description = "pytest: simple powerful testing with Python" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, - {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, + {file = "pytest-8.3.3-py3-none-any.whl", hash = "sha256:a6853c7375b2663155079443d2e45de913a911a11d669df02a50814944db57b2"}, + {file = "pytest-8.3.3.tar.gz", hash = "sha256:70b98107bd648308a7952b06e6ca9a50bc660be218d53c257cc1fc94fda10181"}, ] [package.dependencies] colorama = {version = "*", markers = "sys_platform == \"win32\""} iniconfig = "*" packaging = "*" -pluggy = ">=0.12,<2.0" +pluggy = ">=1.5,<2" [package.extras] -testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "nose", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] +dev = ["argcomplete", "attrs (>=19.2)", "hypothesis (>=3.56)", "mock", "pygments (>=2.7.2)", "requests", "setuptools", "xmlschema"] [[package]] name = "pytest-cov" @@ -4856,4 +4856,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "3.12.5" -content-hash = "6685a9c05a978eb97ae40e72b0589d48390aedb8892d5d84954088477da35259" +content-hash = "d38d3e2388ed0cf83c8b87b5d2545ea327868722fa4db5f6e45fea1759439e3c" diff --git a/pyproject.toml b/pyproject.toml index c74605b74b..15b2d6233c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,7 +92,7 @@ ipdb = "^0.13.13" moto = "^4.1.12" nplusone = "^1.0.0" pdbpp = "^0.10.3" -pytest = "^7.3.1" +pytest = "^8.0.0" pytest-cov = "^5.0.0" pytest-django = "^4.5.2" pytest-env = "^1.0.0" From 3be95ef5492a7d844f7dcc4738839f62b1e4398d Mon Sep 17 00:00:00 2001 From: Anastasia Beglova Date: Thu, 12 Sep 2024 16:24:48 -0400 Subject: [PATCH 2/2] lazy_fixture -> lazy_fixtures --- poetry.lock | 16 ++++++++-------- profiles/permissions_test.py | 11 +++++------ pyproject.toml | 2 +- 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/poetry.lock b/poetry.lock index 4ef51d3b38..da61f5a439 100644 --- a/poetry.lock +++ b/poetry.lock @@ -3252,18 +3252,18 @@ freezegun = ">0.3" pytest = ">=3.0.0" [[package]] -name = "pytest-lazy-fixture" -version = "0.6.3" -description = "It helps to use fixtures in pytest.mark.parametrize" +name = "pytest-lazy-fixtures" +version = "1.1.1" +description = "Allows you to use fixtures in @pytest.mark.parametrize." optional = false -python-versions = "*" +python-versions = "<4.0,>=3.8" files = [ - {file = "pytest-lazy-fixture-0.6.3.tar.gz", hash = "sha256:0e7d0c7f74ba33e6e80905e9bfd81f9d15ef9a790de97993e34213deb5ad10ac"}, - {file = "pytest_lazy_fixture-0.6.3-py3-none-any.whl", hash = "sha256:e0b379f38299ff27a653f03eaa69b08a6fd4484e46fd1c9907d984b9f9daeda6"}, + {file = "pytest_lazy_fixtures-1.1.1-py3-none-any.whl", hash = "sha256:a4b396a361faf56c6305535fd0175ce82902ca7cf668c4d812a25ed2bcde8183"}, + {file = "pytest_lazy_fixtures-1.1.1.tar.gz", hash = "sha256:0c561f0d29eea5b55cf29b9264a3241999ffdb74c6b6e8c4ccc0bd2c934d01ed"}, ] [package.dependencies] -pytest = ">=3.2.5" +pytest = ">=7" [[package]] name = "pytest-mock" @@ -4856,4 +4856,4 @@ testing = ["coverage (>=5.0.3)", "zope.event", "zope.testing"] [metadata] lock-version = "2.0" python-versions = "3.12.5" -content-hash = "d38d3e2388ed0cf83c8b87b5d2545ea327868722fa4db5f6e45fea1759439e3c" +content-hash = "b2aaf45d8fad5d99a21e05b0db7a7d0a651f9e31dc6c8cfa9bb9a7b3cb92f6ad" diff --git a/profiles/permissions_test.py b/profiles/permissions_test.py index 5174be5cf7..4863a3c573 100644 --- a/profiles/permissions_test.py +++ b/profiles/permissions_test.py @@ -2,6 +2,7 @@ """Tests for profile permissions""" import pytest +from pytest_lazy_fixtures import lf from main.factories import UserFactory from profiles.permissions import ( @@ -10,8 +11,6 @@ is_owner_or_privileged_user, ) -lazy = pytest.lazy_fixture - @pytest.fixture def user1(): @@ -28,10 +27,10 @@ def user2(): @pytest.mark.parametrize( ("object_user", "request_user", "is_super", "is_staff", "exp_result"), [ - (lazy("user1"), lazy("user2"), False, False, False), - (lazy("user1"), lazy("user1"), False, False, True), - (lazy("user1"), lazy("user2"), True, False, True), - (lazy("user1"), lazy("user2"), False, True, True), + (lf("user1"), lf("user2"), False, False, False), + (lf("user1"), lf("user1"), False, False, True), + (lf("user1"), lf("user2"), True, False, True), + (lf("user1"), lf("user2"), False, True, True), ], ) def test_is_owner_or_privileged_user( # noqa: PLR0913 diff --git a/pyproject.toml b/pyproject.toml index 15b2d6233c..4dbce214bb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -80,6 +80,7 @@ posthog = "^3.5.0" ruff = "0.6.4" dateparser = "^1.2.0" uwsgitop = "^0.12" +pytest-lazy-fixtures = "^1.1.1" [tool.poetry.group.dev.dependencies] @@ -97,7 +98,6 @@ pytest-cov = "^5.0.0" pytest-django = "^4.5.2" pytest-env = "^1.0.0" pytest-freezegun = "^0.4.2" -pytest-lazy-fixture = "^0.6.3" pytest-mock = "^3.10.0" responses = "^0.25.0" ruff = "^0.6.0"