#1140978 flask-caching: FTBFS: E pytest.PytestRemovedIn10Warning: Class-scoped fixture defined as instance method is deprecated.

#1140978#5
Date:
2026-06-28 20:51:07 UTC
From:
To:
Dear maintainer:

During a rebuild of all packages in unstable, this package failed to build.

Below you will find the last part of the build log (probably the most
relevant part, but not necessarily). If required, the full build log
is available here:

https://people.debian.org/~sanvila/build-logs/202606/

About the archive rebuild: The build was made on virtual machines from AWS,
using sbuild and a reduced chroot with only build-essential packages.

If you cannot reproduce the bug please contact me privately, as I
am willing to provide ssh access to a virtual machine where the bug is
fully reproducible.

If this is really a bug in one of the build-depends, please use
reassign and add an affects on src:flask-caching, so that this is still
visible in the BTS web page for this package.

Thanks.
--------------------------------------------------------------------------------
[...]
 debian/rules clean
dh clean --with python3 --buildsystem=pybuild
   dh_auto_clean -O--buildsystem=pybuild
   dh_autoreconf_clean -O--buildsystem=pybuild
   dh_clean -O--buildsystem=pybuild
 debian/rules binary
dh binary --with python3 --buildsystem=pybuild
   dh_update_autotools_config -O--buildsystem=pybuild
   dh_autoreconf -O--buildsystem=pybuild
   dh_auto_configure -O--buildsystem=pybuild
   dh_auto_build -O--buildsystem=pybuild
I: pybuild plugin_pyproject:142: Building wheel for python3.13 with "build" module
I: pybuild base:385: python3.13 -m build --skip-dependency-check --no-isolation --wheel --outdir /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_flask-caching
* Building wheel...
Successfully built flask_caching-2.4.0-py3-none-any.whl
I: pybuild plugin_pyproject:168: Unpacking wheel built for python3.13 with "installer" module
I: pybuild plugin_pyproject:142: Building wheel for python3.14 with "build" module
I: pybuild base:385: python3.14 -m build --skip-dependency-check --no-isolation --wheel --outdir /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_flask-caching
* Building wheel...
Successfully built flask_caching-2.4.0-py3-none-any.whl
I: pybuild plugin_pyproject:168: Unpacking wheel built for python3.14 with "installer" module
   dh_auto_test -O--buildsystem=pybuild
I: pybuild base:385: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_flask-caching/build; python3.13 -m pytest tests
============================= test session starts ==============================
platform linux -- Python 3.13.14, pytest-9.1.1, pluggy-1.6.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_flask-caching/build
configfile: pyproject.toml
plugins: typeguard-4.4.4
collected 199 items

tests/test_backend_cache.py ...........................sssssssssssssssss [ 22%]
ssssssssssssssssssssssssssssssssssssssss.ssssssssssssssssE               [ 51%]
tests/test_basic_app.py ....ssss..                                       [ 56%]
tests/test_cache.py .....s................                               [ 67%]
tests/test_init.py ......                                                [ 70%]
tests/test_memoize.py ........................................           [ 90%]
tests/test_templates.py .                                                [ 90%]
tests/test_view.py ..................                                    [100%]

==================================== ERRORS ====================================

                                     ^^^^^^

/usr/lib/python3/dist-packages/_pytest/runner.py:361:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/_pytest/runner.py:250: in <lambda>
    lambda: runtest_hook(item=item, **kwds),
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/pluggy/_hooks.py:512: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/_pytest/logging.py:858: in pytest_runtest_setup
    yield
/usr/lib/python3/dist-packages/_pytest/capture.py:895: in pytest_runtest_setup
    return (yield)
            ^^^^^
/usr/lib/python3/dist-packages/_pytest/runner.py:170: in pytest_runtest_setup
    item.session._setupstate.setup(item)
/usr/lib/python3/dist-packages/_pytest/runner.py:536: in setup
    col.setup()
/usr/lib/python3/dist-packages/_pytest/python.py:1710: in setup
    self._request._fillfixtures()
/usr/lib/python3/dist-packages/_pytest/fixtures.py:806: in _fillfixtures
    item.funcargs[argname] = self.getfixturevalue(argname)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/_pytest/fixtures.py:630: in getfixturevalue
    fixturedef = self._get_active_fixturedef(argname)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/_pytest/fixtures.py:726: in _get_active_fixturedef
    fixturedef.execute(request=subrequest)
/usr/lib/python3/dist-packages/_pytest/fixtures.py:1232: in execute
    result: FixtureValue = ihook.pytest_fixture_setup(
/usr/lib/python3/dist-packages/pluggy/_hooks.py:512: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/_pytest/setuponly.py:36: in pytest_fixture_setup
    return (yield)
            ^^^^^
/usr/lib/python3/dist-packages/_pytest/fixtures.py:1313: in pytest_fixture_setup
    fixturefunc = resolve_fixture_function(fixturedef, request)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

fixturedef = <FixtureDef argname='make_cache' scope='class' baseid='tests/test_backend_cache.py::TestNullCache'>
request = <SubRequest 'make_cache' for <Function test_has>>

    def resolve_fixture_function(
        fixturedef: FixtureDef[FixtureValue], request: FixtureRequest
    ) -> _FixtureFunc[FixtureValue]:
        """Get the actual callable that can be called to obtain the fixture
        value."""
        fixturefunc = fixturedef.func
        # The fixture function needs to be bound to the actual
        # request.instance so that code working with "fixturedef" behaves
        # as expected.
        instance = request.instance

        if fixturedef._scope is Scope.Class:
            # Check if fixture is an instance method (bound to instance, not class)
            if hasattr(fixturefunc, "__self__"):
                bound_to = fixturefunc.__self__
                # classmethod: bound_to is the class itself (a type)
                # instance method: bound_to is an instance (not a type)
                if not isinstance(bound_to, type):
E                   as each test gets a new instance while the fixture runs only once per class.
E                   Use @classmethod decorator and set attributes on cls instead.
E                   See https://docs.pytest.org/en/stable/deprecations.html#class-scoped-fixture-as-instance-method

/usr/lib/python3/dist-packages/_pytest/fixtures.py:1289: PytestRemovedIn10Warning
=========================== short test summary info ============================
ERROR tests/test_backend_cache.py::TestNullCache::test_has - pytest.PytestRem...
============= 120 passed, 78 skipped, 1 error in 95.64s (0:01:35) ==============
E: pybuild pybuild:485: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_flask-caching/build; python3.13 -m pytest tests
I: pybuild base:385: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_flask-caching/build; python3.14 -m pytest tests
============================= test session starts ==============================
platform linux -- Python 3.14.6, pytest-9.1.1, pluggy-1.6.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_flask-caching/build
configfile: pyproject.toml
plugins: typeguard-4.4.4
collected 199 items

tests/test_backend_cache.py ...........................sssssssssssssssss [ 22%]
ssssssssssssssssssssssssssssssssssssssss.ssssssssssssssssE               [ 51%]
tests/test_basic_app.py ....ssss..                                       [ 56%]
tests/test_cache.py .....s................                               [ 67%]
tests/test_init.py ......                                                [ 70%]
tests/test_memoize.py ........................................           [ 90%]
tests/test_templates.py .                                                [ 90%]
tests/test_view.py ..................                                    [100%]

==================================== ERRORS ====================================
                                     ^^^^^^

/usr/lib/python3/dist-packages/_pytest/runner.py:361:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/lib/python3/dist-packages/_pytest/runner.py:250: in <lambda>
    lambda: runtest_hook(item=item, **kwds),
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/pluggy/_hooks.py:512: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/_pytest/logging.py:858: in pytest_runtest_setup
    yield
/usr/lib/python3/dist-packages/_pytest/capture.py:895: in pytest_runtest_setup
    return (yield)
            ^^^^^
/usr/lib/python3/dist-packages/_pytest/runner.py:170: in pytest_runtest_setup
    item.session._setupstate.setup(item)
/usr/lib/python3/dist-packages/_pytest/runner.py:536: in setup
    col.setup()
/usr/lib/python3/dist-packages/_pytest/python.py:1710: in setup
    self._request._fillfixtures()
/usr/lib/python3/dist-packages/_pytest/fixtures.py:806: in _fillfixtures
    item.funcargs[argname] = self.getfixturevalue(argname)
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/_pytest/fixtures.py:630: in getfixturevalue
    fixturedef = self._get_active_fixturedef(argname)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/_pytest/fixtures.py:726: in _get_active_fixturedef
    fixturedef.execute(request=subrequest)
/usr/lib/python3/dist-packages/_pytest/fixtures.py:1232: in execute
    result: FixtureValue = ihook.pytest_fixture_setup(
/usr/lib/python3/dist-packages/pluggy/_hooks.py:512: in __call__
    return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/pluggy/_manager.py:120: in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
/usr/lib/python3/dist-packages/_pytest/setuponly.py:36: in pytest_fixture_setup
    return (yield)
            ^^^^^
/usr/lib/python3/dist-packages/_pytest/fixtures.py:1313: in pytest_fixture_setup
    fixturefunc = resolve_fixture_function(fixturedef, request)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

fixturedef = <FixtureDef argname='make_cache' scope='class' baseid='tests/test_backend_cache.py::TestNullCache'>
request = <SubRequest 'make_cache' for <Function test_has>>

    def resolve_fixture_function(
        fixturedef: FixtureDef[FixtureValue], request: FixtureRequest
    ) -> _FixtureFunc[FixtureValue]:
        """Get the actual callable that can be called to obtain the fixture
        value."""
        fixturefunc = fixturedef.func
        # The fixture function needs to be bound to the actual
        # request.instance so that code working with "fixturedef" behaves
        # as expected.
        instance = request.instance

        if fixturedef._scope is Scope.Class:
            # Check if fixture is an instance method (bound to instance, not class)
            if hasattr(fixturefunc, "__self__"):
                bound_to = fixturefunc.__self__
                # classmethod: bound_to is the class itself (a type)
                # instance method: bound_to is an instance (not a type)
                if not isinstance(bound_to, type):
E                   as each test gets a new instance while the fixture runs only once per class.
E                   Use @classmethod decorator and set attributes on cls instead.
E                   See https://docs.pytest.org/en/stable/deprecations.html#class-scoped-fixture-as-instance-method

/usr/lib/python3/dist-packages/_pytest/fixtures.py:1289: PytestRemovedIn10Warning
=========================== short test summary info ============================
ERROR tests/test_backend_cache.py::TestNullCache::test_has - pytest.PytestRem...
============= 120 passed, 78 skipped, 1 error in 95.66s (0:01:35) ==============
E: pybuild pybuild:485: test: plugin pyproject failed with: exit code=1: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.14_flask-caching/build; python3.14 -m pytest tests
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.13 3.14" --parallel=2 returned exit code 13
make: *** [debian/rules:6: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess failed with exit status 2
--------------------------------------------------------------------------------

#1140978#10
Date:
2026-06-28 23:36:24 UTC
From:
To:
Hello,

Bug #1140978 in flask-caching reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/python-team/packages/python3-flask-caching/-/commit/2504e7d1c0207d275c9fb24b298198b09db875b8
------------------------------------------------------------------------
Don't define class-scoped fixtures as instance methods

Closes: #1140978
------------------------------------------------------------------------

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1140978

#1140978#17
Date:
2026-06-29 00:04:55 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
flask-caching, which is due to be installed in the Debian FTP archive.

A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 1140978@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Colin Watson <cjwatson@debian.org> (supplier of updated flask-caching package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Mon, 29 Jun 2026 00:28:42 +0100
Source: flask-caching
Architecture: source
Version: 2.4.0-2
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+python@tracker.debian.org>
Changed-By: Colin Watson <cjwatson@debian.org>
Closes: 1140978
Changes:
 flask-caching (2.4.0-2) unstable; urgency=medium
 .
   * Team upload.
   * Don't define class-scoped fixtures as instance methods (closes:
     #1140978).
   * Drop "Rules-Requires-Root: no", default as of dpkg-dev 1.22.13.
Checksums-Sha1:
 d6be85da54694cc1dd82e97bdda5cf8af4a57eda 2656 flask-caching_2.4.0-2.dsc
 e71c801c877e7d18d9626fcc43586d15fd21aa9f 4484 flask-caching_2.4.0-2.debian.tar.xz
 23ab9b1ae3dce43fe8cb621dd953121ff04b4c48 199100 flask-caching_2.4.0-2.git.tar.xz
 e328a96b2d92771d4dab34c22bf0ed298966d204 17520 flask-caching_2.4.0-2_source.buildinfo
Checksums-Sha256:
 9821a7485e01fd15fa5a766522f58409f27b40351ef6639c513a9db862e943f9 2656 flask-caching_2.4.0-2.dsc
 30364d1be667d8eff9421310352282329f5d9c56b24ed87e34f735cd4a7ff033 4484 flask-caching_2.4.0-2.debian.tar.xz
 5e7d86d963c5d23137fed372b784f160d7c51aa9e224327860630c2681219323 199100 flask-caching_2.4.0-2.git.tar.xz
 e77d902277191867e3058bbdd3280fef69d8b79a026a3b257faf153f908968e0 17520 flask-caching_2.4.0-2_source.buildinfo
Files:
 32e479c3f85ab7ed6ab84ec9c7a0d702 2656 python optional flask-caching_2.4.0-2.dsc
 8b3caea08c5ee8d1e62d3155581a3c86 4484 python optional flask-caching_2.4.0-2.debian.tar.xz
 23efc5852ff9ce8f36b87b391f708948 199100 python None flask-caching_2.4.0-2.git.tar.xz
 f6f94a76cbcf879b406f57b280f84dd2 17520 python optional flask-caching_2.4.0-2_source.buildinfo
Git-Tag-Info: tag=d5e76a73d3a41c3480cea16b24d2087feca57a51 fp=ac0a4ff12611b6fccf01c111393587d97d86500b
Git-Tag-Tagger: Colin Watson <cjwatson@debian.org>
-----BEGIN PGP SIGNATURE-----

iQIzBAEBCgAdFiEEN02M5NuW6cvUwJcqYG0ITkaDwHkFAmpBsEQACgkQYG0ITkaD
wHkEoBAA72u6WGw6dHpN3iUrZKyqiT+X2cqxjDj55+3ilKNlJxmp2tB3rhE2XdOT
CuMwwldsGuGXObSceALokG7HW8voLsUQSQ6DeMdIasT68sQy5zou2yM5S38v7vQA
0n3OOk6zYwfwdVy/9Em2TvjxQqHOw6y8e+6QGjw9WZp/Xq2HIuGXIEp3SyucBePf
i8RdR4lsLAxs/Qu0I4tgrL3+rkKt6ocq0JZUfjqmS6kLXNT33TIzly1wKreaUIQB
Tr0kvEJkqgcpBF5lShaPC7DBsklNVFJFkelvVddAr25lWmYTt+WTcxQ8CqwjgEqx
Xp8n9TfnqX1pkuxzqhUz5M/Lxaf3WAZFixRzzj04R6kvidqBSmXCBWd3SG59XlCE
+gE2tf2dsrnVKmiN73CqnBxl6MuKnX0N7BwRm21F8YYiIt7n6k0XQuTvwg8MKmLt
FhCNCP8ZREKb2LJftu8m6ia3q2FicBaViuO7EUHLIpcP1EFGK10bafdFZk44zJrH
0NXZLYTIos0yV/b+2GvJ1ux/6HHryUR5JpYrRfQf+V58TO2X6CzdIaGEZ1IFJ/x2
+5NQefzOgYXwAkAB3M63NyzcwSELtgOMSf6fFWayvPpU13bfjH3eByLcoLdINt1l
Q/BFt5IrF9mLvmn/OlZNByIO8eE+GwBIf8p0UasEykfDcroT7WM=
=oTOM
-----END PGP SIGNATURE-----