Bug 2274501

Summary: python-marshmallow-enum fails to build with pytest 8: AttributeError: 'TestEnumFieldByName' object has no attribute 'field'
Product: [Fedora] Fedora Reporter: Tomáš Hrnčiar <thrnciar>
Component: python-marshmallow-enumAssignee: Fabian Affolter <mail>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: igor.raits, mail, 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: 2025-01-31 16:39:00 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-04-11 12:26:57 UTC
python-marshmallow-enum fails to build with pytest 8.

=================================== FAILURES ===================================
___________________ TestEnumFieldByName.test_serialize_enum ____________________

self = <test_enum_field.TestEnumFieldByName object at 0x7f4a62cd2f90>

    def test_serialize_enum(self):
>       assert self.field._serialize(EnumTester.one, None, object()) == 'one'
E       AttributeError: 'TestEnumFieldByName' object has no attribute 'field'

tests/test_enum_field.py:34: AttributeError
___________________ TestEnumFieldByName.test_serialize_none ____________________

self = <test_enum_field.TestEnumFieldByName object at 0x7f4a62cd3080>

    def test_serialize_none(self):
>       assert self.field._serialize(None, None, object()) is None
E       AttributeError: 'TestEnumFieldByName' object has no attribute 'field'

tests/test_enum_field.py:37: AttributeError
__________________ TestEnumFieldByName.test_deserialize_enum ___________________

self = <test_enum_field.TestEnumFieldByName object at 0x7f4a62cd31a0>

    def test_deserialize_enum(self):
>       assert self.field._deserialize('one', None, {}) == EnumTester.one
E       AttributeError: 'TestEnumFieldByName' object has no attribute 'field'

tests/test_enum_field.py:40: AttributeError
__________________ TestEnumFieldByName.test_deserialize_none ___________________

self = <test_enum_field.TestEnumFieldByName object at 0x7f4a62cd32c0>

    def test_deserialize_none(self):
>       assert self.field._deserialize(None, None, {}) is None
E       AttributeError: 'TestEnumFieldByName' object has no attribute 'field'

tests/test_enum_field.py:43: AttributeError
___________ TestEnumFieldByName.test_deserialize_nonexistent_member ____________

self = <test_enum_field.TestEnumFieldByName object at 0x7f4a62cd33e0>

    def test_deserialize_nonexistent_member(self):
        with pytest.raises(ValidationError):
>           self.field._deserialize('fred', None, {})
E           AttributeError: 'TestEnumFieldByName' object has no attribute 'field'

tests/test_enum_field.py:47: AttributeError
=========================== short test summary info ============================
FAILED tests/test_enum_field.py::TestEnumFieldByName::test_serialize_enum - A...
FAILED tests/test_enum_field.py::TestEnumFieldByName::test_serialize_none - A...
FAILED tests/test_enum_field.py::TestEnumFieldByName::test_deserialize_enum
FAILED tests/test_enum_field.py::TestEnumFieldByName::test_deserialize_none
FAILED tests/test_enum_field.py::TestEnumFieldByName::test_deserialize_nonexistent_member
================== 5 failed, 36 passed, 12 warnings in 0.09s ===================

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/07248352-python-marshmallow-enum/

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

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.