Bug 2081968
Summary: | python-rpmautospec fails to build with Python 3.11: unittest.mock.InvalidSpecError: Cannot spec a Mock object. | ||
---|---|---|---|
Product: | [Fedora] Fedora | Reporter: | Tomáš Hrnčiar <thrnciar> |
Component: | python-rpmautospec | Assignee: | Nils Philippsen <nphilipp> |
Status: | CLOSED RAWHIDE | QA Contact: | Fedora Extras Quality Assurance <extras-qa> |
Severity: | unspecified | Docs Contact: | |
Priority: | unspecified | ||
Version: | rawhide | CC: | asaleh, epel-packagers-sig, infra-sig, mhroncok, michel, nphilipp, thrnciar |
Target Milestone: | --- | ||
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | python-rpmautospec-0.2.8-1.fc37 | Doc Type: | If docs needed, set a value |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2022-05-16 16:31:48 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: | 2081969 | ||
Bug Blocks: | 2016048 |
Description
Tomáš Hrnčiar
2022-05-05 06:40:41 UTC
Replacing: pkg_converter = unittest.mock.Mock(spec=convert.PkgConverter)() ...with: pkg_converter = convert.PkgConverter() ...does the trick. convert.PkgConverter is already a mock. (In reply to Miro Hrončok from comment #1) > Replacing: > > pkg_converter = unittest.mock.Mock(spec=convert.PkgConverter)() > > ...with: > > pkg_converter = convert.PkgConverter() > > ...does the trick. convert.PkgConverter is already a mock. Yeah, but that just seems to hide issues. I didn't write the test myself and I'm still figuring out how it's supposed to work but it looks pretty much as if things should be run through the real `PkgConverter` object and the mock just exists to be able to inspect what was called and such. Hmm, I guess I was wrong with my assumption, but there's still a way to make this nicer. |