Bug 2120019 - fedpkg tests require depracated python3-mock
Summary: fedpkg tests require depracated python3-mock
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: fedpkg
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Ondřej Nosek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-08-20 23:44 UTC by Troy Dawson
Modified: 2022-09-21 13:22 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-09-21 13:22:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Troy Dawson 2022-08-20 23:44:04 UTC
Description of problem:
python-mock has been deprated in fedora.
https://fedoraproject.org/wiki/Changes/DeprecatePythonMock
fedpkg still uses it in it's test suite.

Version-Release number of selected component (if applicable):
fedpkg-1.42-5.fc37 (And every stable version before it)

How reproducible:
100%

Steps to Reproduce:
1. Comment out "BuildRequires:  python3-mock"
2. Create a new srpm
3. Try to build that srpm in Koji, Copr, or mock

Actual results:
Fails with


+ /usr/bin/pytest
============================= test session starts ==============================
platform linux -- Python 3.10.6, pytest-6.2.5, py-1.11.0, pluggy-1.0.0
rootdir: /builddir/build/BUILD/fedpkg-1.42, configfile: setup.cfg, testpaths: test
collected 0 items / 5 errors

==================================== ERRORS ====================================
____________________ ERROR collecting test/test_bugzilla.py ____________________
ImportError while importing test module '/builddir/build/BUILD/fedpkg-1.42/test/test_bugzilla.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test/test_bugzilla.py:14: in <module>
    from mock import Mock, patch
E   ModuleNotFoundError: No module named 'mock'
______________________ ERROR collecting test/test_cli.py _______________________
ImportError while importing test module '/builddir/build/BUILD/fedpkg-1.42/test/test_cli.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test/test_cli.py:25: in <module>
    from mock import Mock, PropertyMock, call, patch
E   ModuleNotFoundError: No module named 'mock'
____________________ ERROR collecting test/test_commands.py ____________________
ImportError while importing test module '/builddir/build/BUILD/fedpkg-1.42/test/test_commands.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test/test_commands.py:13: in <module>
    from mock import Mock, PropertyMock, call, mock_open, patch
E   ModuleNotFoundError: No module named 'mock'
_____________________ ERROR collecting test/test_retire.py _____________________
ImportError while importing test module '/builddir/build/BUILD/fedpkg-1.42/test/test_retire.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test/test_retire.py:8: in <module>
    import mock
E   ModuleNotFoundError: No module named 'mock'
_____________________ ERROR collecting test/test_utils.py ______________________
ImportError while importing test module '/builddir/build/BUILD/fedpkg-1.42/test/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib64/python3.10/importlib/__init__.py:126: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test/test_utils.py:16: in <module>
    from mock import Mock, patch
E   ModuleNotFoundError: No module named 'mock'
=========================== short test summary info ============================
ERROR test/test_bugzilla.py
ERROR test/test_cli.py
ERROR test/test_commands.py
ERROR test/test_retire.py
ERROR test/test_utils.py
!!!!!!!!!!!!!!!!!!! Interrupted: 5 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 5 errors in 0.23s ===============================


Expected results:
Tests should pass without python3-mock.


Additional info:

Comment 1 Orion Poplawski 2022-09-02 02:55:08 UTC
This should hopefully be fixed in this upstream commit: https://pagure.io/fedpkg/c/308ac3138c2739feaf1587a598e4d77b7068c936?branch=master

Comment 2 Troy Dawson 2022-09-21 13:22:23 UTC
Yes.  It is fixed and it allowed us to build fedpkg in epel9 without python3-mock.
Thank You


Note You need to log in before you can comment on or make changes to this bug.