#1006736 python-pytest-asyncio breaks pytest-mock autopkgtest: nomatch: '* 1 passed in *'

Package:
src:pytest-mock
Source:
pytest-mock
Submitter:
Paul Gevers
Date:
2022-05-27 07:24:03 UTC
Severity:
serious
Tags:
#1006736#5
Date:
2022-03-03 20:46:57 UTC
From:
To:
Dear maintainer(s),

With a recent upload of python-pytest-asyncio the autopkgtest of
pytest-mock fails in testing when that autopkgtest is run with the
binary packages of python-pytest-asyncio from unstable. It passes when
run with only packages from testing. In tabular form:

                        pass            fail
python-pytest-asyncio  from testing    0.18.1-1
pytest-mock            from testing    3.6.1-1
all others             from testing    from testing

I copied some of the output at the bottom of this report.

Currently this regression is blocking the migration of
python-pytest-asyncio to testing [1]. Due to the nature of this issue, I
filed this bug report against both packages. Can you please investigate
the situation and reassign the bug to the right package?

More information about this bug and the reason for filing it can be found on
https://wiki.debian.org/ContinuousIntegration/RegressionEmailInformation

Paul

[1] https://qa.debian.org/excuses.php?package=python-pytest-asyncio

https://ci.debian.net/data/autopkgtest/testing/amd64/p/pytest-mock/19680464/log.gz

=================================== FAILURES
===================================
E       Failed: nomatch: '* 1 passed in *'
E           and: '============================= test session starts
=============================='
E           and: 'platform linux -- Python 3.10.2, pytest-6.2.5,
py-1.10.0, pluggy-0.13.0'
E           and: 'rootdir:
/tmp/pytest-of-debci/pytest-0/test_plain_stopall0'
E           and: 'plugins: asyncio-0.18.1, mock-3.6.1'
E           and: 'asyncio: mode=legacy'
E           and: 'collected 1 item'
E           and: ''
E           and: 'test_plain_stopall.py .
                    [100%]'
E           and: ''
E           and: '=============================== warnings summary
==============================='
E           and:
'../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191'
E           and: "
/usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file."
E           and: '    config.issue_config_time_warning(LEGACY_MODE,
stacklevel=2)'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/stable/warnings.html'
E           and: '========================= 1 passed, 1 warning in 0.02s
========================='
E       remains unmatched: '* 1 passed in *'

/tmp/autopkgtest-lxc.p64demaa/downtmp/autopkgtest_tmp/tests/test_pytest_mock.py:842:
Failed
----------------------------- Captured stdout call 
-----------------------------
running: /usr/bin/python3.10 -mpytest
--basetemp=/tmp/pytest-of-debci/pytest-0/test_plain_stopall0/runpytest-0
      in: /tmp/pytest-of-debci/pytest-0/test_plain_stopall0
============================= test session starts
==============================
platform linux -- Python 3.10.2, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /tmp/pytest-of-debci/pytest-0/test_plain_stopall0
plugins: asyncio-0.18.1, mock-3.6.1
asyncio: mode=legacy
collected 1 item

test_plain_stopall.py .
  [100%]

=============================== warnings summary
===============================
../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191
   /usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file.
     config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

E       Failed: nomatch: '* 1 passed in *'
E           and: '============================= test session starts
=============================='
E           and: 'platform linux -- Python 3.10.2, pytest-6.2.5,
py-1.10.0, pluggy-0.13.0'
E           and: 'rootdir:
/tmp/pytest-of-debci/pytest-0/test_used_with_class_scope0'
E           and: 'plugins: asyncio-0.18.1, mock-3.6.1'
E           and: 'asyncio: mode=legacy'
E           and: 'collected 1 item'
E           and: ''
E           and: 'test_used_with_class_scope.py .
                    [100%]'
E           and: ''
E           and: '=============================== warnings summary
==============================='
E           and:
'../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191'
E           and: "
/usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file."
E           and: '    config.issue_config_time_warning(LEGACY_MODE,
stacklevel=2)'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/stable/warnings.html'
E           and: '========================= 1 passed, 1 warning in 0.02s
========================='
E       remains unmatched: '* 1 passed in *'

/tmp/autopkgtest-lxc.p64demaa/downtmp/autopkgtest_tmp/tests/test_pytest_mock.py:981:
Failed
----------------------------- Captured stdout call 
-----------------------------
running: /usr/bin/python3.10 -mpytest
--basetemp=/tmp/pytest-of-debci/pytest-0/test_used_with_class_scope0/runpytest-0
      in: /tmp/pytest-of-debci/pytest-0/test_used_with_class_scope0
============================= test session starts
==============================
platform linux -- Python 3.10.2, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /tmp/pytest-of-debci/pytest-0/test_used_with_class_scope0
plugins: asyncio-0.18.1, mock-3.6.1
asyncio: mode=legacy
collected 1 item

test_used_with_class_scope.py .
  [100%]

=============================== warnings summary
===============================
../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191
   /usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file.
     config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

E       Failed: nomatch: '* 1 passed in *'
E           and: '============================= test session starts
=============================='
E           and: 'platform linux -- Python 3.10.2, pytest-6.2.5,
py-1.10.0, pluggy-0.13.0'
E           and: 'rootdir:
/tmp/pytest-of-debci/pytest-0/test_used_with_module_scope0'
E           and: 'plugins: asyncio-0.18.1, mock-3.6.1'
E           and: 'asyncio: mode=legacy'
E           and: 'collected 1 item'
E           and: ''
E           and: 'test_used_with_module_scope.py .
                    [100%]'
E           and: ''
E           and: '=============================== warnings summary
==============================='
E           and:
'../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191'
E           and: "
/usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file."
E           and: '    config.issue_config_time_warning(LEGACY_MODE,
stacklevel=2)'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/stable/warnings.html'
E           and: '========================= 1 passed, 1 warning in 0.02s
========================='
E       remains unmatched: '* 1 passed in *'

/tmp/autopkgtest-lxc.p64demaa/downtmp/autopkgtest_tmp/tests/test_pytest_mock.py:1003:
Failed
----------------------------- Captured stdout call 
-----------------------------
running: /usr/bin/python3.10 -mpytest
--basetemp=/tmp/pytest-of-debci/pytest-0/test_used_with_module_scope0/runpytest-0
      in: /tmp/pytest-of-debci/pytest-0/test_used_with_module_scope0
============================= test session starts
==============================
platform linux -- Python 3.10.2, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /tmp/pytest-of-debci/pytest-0/test_used_with_module_scope0
plugins: asyncio-0.18.1, mock-3.6.1
asyncio: mode=legacy
collected 1 item

test_used_with_module_scope.py .
  [100%]

=============================== warnings summary
===============================
../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191
   /usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file.
     config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

E       Failed: nomatch: '* 1 passed in *'
E           and: '============================= test session starts
=============================='
E           and: 'platform linux -- Python 3.10.2, pytest-6.2.5,
py-1.10.0, pluggy-0.13.0'
E           and: 'rootdir:
/tmp/pytest-of-debci/pytest-0/test_used_with_package_scope0'
E           and: 'plugins: asyncio-0.18.1, mock-3.6.1'
E           and: 'asyncio: mode=legacy'
E           and: 'collected 1 item'
E           and: ''
E           and: 'test_used_with_package_scope.py .
                    [100%]'
E           and: ''
E           and: '=============================== warnings summary
==============================='
E           and:
'../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191'
E           and: "
/usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file."
E           and: '    config.issue_config_time_warning(LEGACY_MODE,
stacklevel=2)'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/stable/warnings.html'
E           and: '========================= 1 passed, 1 warning in 0.02s
========================='
E       remains unmatched: '* 1 passed in *'

/tmp/autopkgtest-lxc.p64demaa/downtmp/autopkgtest_tmp/tests/test_pytest_mock.py:1026:
Failed
----------------------------- Captured stdout call 
-----------------------------
running: /usr/bin/python3.10 -mpytest
--basetemp=/tmp/pytest-of-debci/pytest-0/test_used_with_package_scope0/runpytest-0
      in: /tmp/pytest-of-debci/pytest-0/test_used_with_package_scope0
============================= test session starts
==============================
platform linux -- Python 3.10.2, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /tmp/pytest-of-debci/pytest-0/test_used_with_package_scope0
plugins: asyncio-0.18.1, mock-3.6.1
asyncio: mode=legacy
collected 1 item

test_used_with_package_scope.py .
  [100%]

=============================== warnings summary
===============================
../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191
   /usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file.
     config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

E       Failed: nomatch: '* 1 passed in *'
E           and: '============================= test session starts
=============================='
E           and: 'platform linux -- Python 3.10.2, pytest-6.2.5,
py-1.10.0, pluggy-0.13.0'
E           and: 'rootdir:
/tmp/pytest-of-debci/pytest-0/test_used_with_session_scope0'
E           and: 'plugins: asyncio-0.18.1, mock-3.6.1'
E           and: 'asyncio: mode=legacy'
E           and: 'collected 1 item'
E           and: ''
E           and: 'test_used_with_session_scope.py .
                    [100%]'
E           and: ''
E           and: '=============================== warnings summary
==============================='
E           and:
'../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191'
E           and: "
/usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file."
E           and: '    config.issue_config_time_warning(LEGACY_MODE,
stacklevel=2)'
E           and: ''
E           and: '-- Docs: https://docs.pytest.org/en/stable/warnings.html'
E           and: '========================= 1 passed, 1 warning in 0.02s
========================='
E       remains unmatched: '* 1 passed in *'

/tmp/autopkgtest-lxc.p64demaa/downtmp/autopkgtest_tmp/tests/test_pytest_mock.py:1049:
Failed
----------------------------- Captured stdout call 
-----------------------------
running: /usr/bin/python3.10 -mpytest
--basetemp=/tmp/pytest-of-debci/pytest-0/test_used_with_session_scope0/runpytest-0
      in: /tmp/pytest-of-debci/pytest-0/test_used_with_session_scope0
============================= test session starts
==============================
platform linux -- Python 3.10.2, pytest-6.2.5, py-1.10.0, pluggy-0.13.0
rootdir: /tmp/pytest-of-debci/pytest-0/test_used_with_session_scope0
plugins: asyncio-0.18.1, mock-3.6.1
asyncio: mode=legacy
collected 1 item

test_used_with_session_scope.py .
  [100%]

=============================== warnings summary
===============================
../../../../usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191
   /usr/lib/python3/dist-packages/pytest_asyncio/plugin.py:191:
DeprecationWarning: The 'asyncio_mode' default value will change to
'strict' in future, please explicitly use 'asyncio_mode=strict' or
'asyncio_mode=auto' in pytest configuration file.
     config.issue_config_time_warning(LEGACY_MODE, stacklevel=2)

#1006736#16
Date:
2022-04-24 09:44:05 UTC
From:
To:
Hi,

As both python-pytest-asyncio and pytest-mock are key packages, this bug
isn't fixing anything with autoremoval, so action is needed to resolve
this. I had a brief look (tried to create a patch). At least the
"nomatch" part looks like just upgrading pytest-mock to not be sensitive
to a deprecation warning, hence reassigning.

The "nomatch" problem could easily be fixed (e.g. by taking the test
related changes from upstream commit
0b869db2e019c23421d74af719766d6e2fc79f6a) but by now pytest-mock is also
picking up failures due to python3.10 being the default now in
combination with the new python-pytest-asyncio. I wasn't (quickly) able
to isolate a patch, but upstream pytest-mock has a newer release so
maybe the newer release with the Python3.10+new-asyncio-support patch
would solve the issue.

Paul

#1006736#33
Date:
2022-05-27 07:20:19 UTC
From:
To:
We believe that the bug you reported is fixed in the latest version of
pytest-mock, 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 1006736@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Julian Gilbey <jdg@debian.org> (supplier of updated pytest-mock 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: Fri, 27 May 2022 07:37:21 +0100
Source: pytest-mock
Architecture: source
Version: 3.7.0-1
Distribution: unstable
Urgency: medium
Maintainer: Debian Python Team <team+python@tracker.debian.org>
Changed-By: Julian Gilbey <jdg@debian.org>
Closes: 1006736
Changes:
 pytest-mock (3.7.0-1) unstable; urgency=medium
 .
   * Team upload
   * New upstream version (Closes: 1006736)
Checksums-Sha1:
 604801b7ff8841a4e7c77c2c7470346d46987e7d 2223 pytest-mock_3.7.0-1.dsc
 61c5a29cf5ea26ad074dac6f85e9f1d9f437d8b6 25347 pytest-mock_3.7.0.orig.tar.gz
 d467f536089cc3427a58e6de9a33d43ec4aabb34 3392 pytest-mock_3.7.0-1.debian.tar.xz
 2483b6ef3a11200a7eba1770af7ef57df0f83533 6823 pytest-mock_3.7.0-1_amd64.buildinfo
Checksums-Sha256:
 db76a3abdabe8a27fb65a39a15bb2819f44dec2201f7e1a5451ddbe9ac48cb15 2223 pytest-mock_3.7.0-1.dsc
 c3be21636000cc7792b1af9dd1bd0e35228b7bc58617ab7799924a503877705c 25347 pytest-mock_3.7.0.orig.tar.gz
 2838c06d92c899fdd63fd7f49e935f645616e84b52ca3b01e70281ec844045b6 3392 pytest-mock_3.7.0-1.debian.tar.xz
 98b564925408b553d4f949f456d1a909aa41587c0b51d46da7dba2bfeb706355 6823 pytest-mock_3.7.0-1_amd64.buildinfo
Files:
 5b4f488082ec16ef03d2748887711859 2223 python optional pytest-mock_3.7.0-1.dsc
 5f64bc5c2f256c721a9f28d3d23dc974 25347 python optional pytest-mock_3.7.0.orig.tar.gz
 ec945be60a216a03dd32f6df2699bccf 3392 python optional pytest-mock_3.7.0-1.debian.tar.xz
 6506874106c1c1a3e9690f8354d4f677 6823 python optional pytest-mock_3.7.0-1_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----

iQJDBAEBCAAtFiEEfhrD+iemSShMMj72aVxCkxbAe/4FAmKQcgoPHGpkZ0BkZWJp
YW4ub3JnAAoJEGlcQpMWwHv+/+UP/21f/81T5zsgT8KDIWEE7TbCgmEuajdPdUhO
Pwi09lGtyUSB4p7+LX2L9BCEFt9yzSmlusF94sPQ0aAZQFMCDpb8jgT/dMEeZqtg
xslDuDMmCZCtH2PM9NB48O60W7T26PAVbIIWVG3L8550RURqK9hAc51krboaqusV
jQS7PM68pjuycsynwaHuQ385Elq8MEOsk1KDVkUGpAHDW0iEWQPPzyssRFR6mIfw
lWUg8tDO1Kq/jDCWNW/NuLaFhBH2w3p7h93ngt7OJzuTK75r847kxQ/JzN1Badwv
1Y7Kz32Zk4GydwqnqP2PWHJm23Cu0swEJs8njhlsZyz6PrfjsjqbmAEYNkxXovDY
hh9ejCZ7Ag5vobnrbNYCIq2GCFwFQJC3N5dSmVWXJ/xW+oYswRrDcYTxnOgL76pq
LVpbnK7ZUBrl8VqylBnMORAZ4trBp6z+Zde1pEgZiMeQWMjplRO/ZWW0+btg8BNx
vuQM0otRtjU6cnvQb1caysluR/7CnA3cLv8wK2222Yi7aZra/P26P3URj3/6Clpi
FGoJUdeAM6P9SO4/v0dzEX783tLeF/4te1Ib/aiWumMDw0ME4aMjOXyr7f/UR85G
M+x/t7P4LcOLhtwb4Itx3tjt7IHzKr8Sfab/cIYANsG2X+x8tJrojYpSQkYyuRii
NCHFkuby
=K2RR
-----END PGP SIGNATURE-----