Bug 2278885

Summary: python-gitdb fails to build with pytest 8: AssertionError: BadObject not raised by partial_to_complete_sha_hex
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-gitdbAssignee: Lubomír Sedlář <lsedlar>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: athoscribeiro, carl, igor.raits, lsedlar, mhroncok, thrnciar
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2024-05-21 10:23:15 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:    
Bug Blocks: 2256331    

Description Tomáš Hrnčiar 2024-05-03 13:31:28 UTC
python-gitdb fails to build with pytest 8.

=================================== FAILURES ===================================
____________________________ TestGitDB.test_reading ____________________________

self = <gitdb.test.db.test_git.TestGitDB testMethod=test_reading>

    def test_reading(self):
        gdb = GitDB(os.path.join(self.gitrepopath, 'objects'))
    
        # we have packs and loose objects, alternates doesn't necessarily exist
        assert 1 < len(gdb.databases()) < 4
    
        # access should be possible
        gitdb_sha = next(gdb.sha_iter())
        assert isinstance(gdb.info(gitdb_sha), OInfo)
        assert isinstance(gdb.stream(gitdb_sha), OStream)
        ni = 50
        assert gdb.size() >= ni
        sha_list = list(gdb.sha_iter())
        assert len(sha_list) == gdb.size()
        sha_list = sha_list[:ni]  # speed up tests ...
    
        # This is actually a test for compound functionality, but it doesn't
        # have a separate test module
        # test partial shas
        # this one as uneven and quite short
        gitdb_sha_hex = bin_to_hex(gitdb_sha)
        assert gdb.partial_to_complete_sha_hex(gitdb_sha_hex[:5]) == gitdb_sha
    
        # mix even/uneven hexshas
        for i, binsha in enumerate(sha_list):
            assert gdb.partial_to_complete_sha_hex(bin_to_hex(binsha)[:8 - (i % 2)]) == binsha
        # END for each sha
    
>       self.assertRaises(BadObject, gdb.partial_to_complete_sha_hex, "0000")
E       AssertionError: BadObject not raised by partial_to_complete_sha_hex

gitdb/test/db/test_git.py:46: AssertionError
=========================== short test summary info ============================
FAILED gitdb/test/db/test_git.py::TestGitDB::test_reading - AssertionError: B...
=================== 1 failed, 22 passed, 1 skipped in 20.97s ===================

https://docs.pytest.org/en/stable/changelog.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/thrnciar/pytest/fedora-rawhide-x86_64/07388944-python-gitdb/

For all our attempts to build python-gitdb with pytest 8, see:
https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/package/python-gitdb/

Let us know here if you have any questions.

Pytest 8 is planned to be included in Fedora 41. And this bugzilla is a
heads up before we merge new pytest into rawhide. For more info see a Fedora Change
proposal https://fedoraproject.org/wiki/Changes/Pytest_8

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Tomáš Hrnčiar 2024-05-21 10:23:15 UTC
I've got a successful build with pytest 8.2.1.

https://copr.fedorainfracloud.org/coprs/thrnciar/pytest/build/7464235/