Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.

Bug 1687384

Summary: pytest FTBFS (not only with Python 3.8)
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: pytestAssignee: Miro Hrončok <mhroncok>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: mrunge, thomas.moschny
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: pytest-4.3.1-1.fc31 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-04-09 10:58:56 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1671167    
Bug Blocks: 1686977    
Attachments:
Description Flags
build.log from copr
none
root.log from copr
none
build.log from copr, Python 3.8 tests first none

Description Miro Hrončok 2019-03-11 12:29:42 UTC
pytest-3.9.3-3.fc31 FTBFS, Python 2 tests give:

    import unittest.mock as mock
E   ImportError: No module named mock

That is kinda expected as this was added in Python 3. Yet it used to work.



+ /builddir/build/BUILDROOT/pytest-3.9.3-3.fc31.x86_64/usr/bin/pytest-2.7 -r s testing
============================= test session starts ==============================
platform linux2 -- Python 2.7.16, pytest-3.9.3, py-1.7.0, pluggy-0.8.1
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/builddir/build/BUILD/pytest-3.9.3/.hypothesis/examples')
rootdir: /builddir/build/BUILD/pytest-3.9.3, inifile: tox.ini
plugins: hypothesis-4.9.0
collected 2185 items / 2 errors
==================================== ERRORS ====================================
____________________ ERROR collecting testing/test_mark.py _____________________
ImportError while importing test module '/builddir/build/BUILD/pytest-3.9.3/testing/test_mark.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python2.7/site-packages/six.py:709: in exec_
    exec("""exec _code_ in _globs_, _locs_""")
testing/test_mark.py:11: in <module>
    import unittest.mock as mock
E   ImportError: No module named mock
__________________ ERROR collecting testing/code/test_code.py __________________
ImportError while importing test module '/builddir/build/BUILD/pytest-3.9.3/testing/code/test_code.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python2.7/site-packages/six.py:709: in exec_
    exec("""exec _code_ in _globs_, _locs_""")
testing/code/test_code.py:17: in <module>
    import unittest.mock as mock
E   ImportError: No module named mock
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
=========================== 2 error in 4.99 seconds ============================



https://apps.fedoraproject.org/koschei/package/pytest

I suspect the update to python2-six 1.11.0-7.fc30.

Fresh scratch build: https://koji.fedoraproject.org/koji/taskinfo?taskID=33397478 seems to get past the failure, will investigate.

Comment 1 Miro Hrončok 2019-03-11 12:30:09 UTC
BTW I need pytest to build to bootstrap Python 3.8.

Comment 2 Miro Hrončok 2019-03-11 12:32:45 UTC
Created attachment 1542862 [details]
build.log from copr

Comment 3 Miro Hrončok 2019-03-11 12:33:07 UTC
Created attachment 1542863 [details]
root.log from copr

Comment 4 Miro Hrončok 2019-03-11 14:45:19 UTC
Note:

In rawhide, there is a separate test failure with Python 3.7.

In copr with Python 3.8, the python2 tests fail to run.

Comment 5 Miro Hrončok 2019-03-11 15:00:33 UTC
More importantly, there are 5 failed tests on Python 3.8. I think we need to bump pytest to 4.x

https://github.com/pytest-dev/pytest/commit/0c5e717f43151852efb08ac72b0f0691443ab352

Will attach build.log.

Comment 6 Miro Hrončok 2019-03-11 15:01:44 UTC
Created attachment 1542917 [details]
build.log from copr, Python 3.8 tests first

Comment 7 Miro Hrončok 2019-03-12 14:40:17 UTC
I've solved the Python 2 failure: mock is no longer an optional test dependency on Python 2.

Comment 8 Miro Hrončok 2019-03-12 15:04:57 UTC
Another failure: https://github.com/pytest-dev/pytest/issues/4913

Comment 9 Miro Hrončok 2019-03-12 15:42:09 UTC
Another (already fixed) failure: https://github.com/pytest-dev/pytest/issues/4716