Skip to content

tests: do not depend on CPython's 'test' package - #51

Merged
zpetrace merged 1 commit into
candlepin:mainfrom
prownd:tests-do-not-depend-on-CPython-s-test-package-s01
Sep 30, 2026
Merged

zpetrace merged 1 commit into
candlepin:mainfrom
prownd:tests-do-not-depend-on-CPython-s-test-package-s01

Conversation

@prownd

@prownd prownd commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

test_compat.py imported 'test.support' only to locate the 'cfgparser.1' data file shipped with CPython's own test suite. That package is not installed on many systems (it is packaged separately, e.g. python3-test on Fedora/CentOS), so the whole module failed to import:

ModuleNotFoundError: No module named 'test'

and 'python3 -m pytest' aborted during collection. Create the needed file in a temporary directory instead, and drop python3-test from the CI pre-test script.

Fixes: #28

test_compat.py imported 'test.support' only to locate the 'cfgparser.1'
data file shipped with CPython's own test suite.  That package is not
installed on many systems (it is packaged separately, e.g. python3-test
on Fedora/CentOS), so the whole module failed to import:

    ModuleNotFoundError: No module named 'test'

and 'python3 -m pytest' aborted during collection.  Create the needed
file in a temporary directory instead, and drop python3-test from the
CI pre-test script.

Fixes: candlepin#28

@zpetrace zpetrace left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The changes looks good, it makes sense and thanks for taking the time to change it! LGTM:)

@zpetrace
zpetrace merged commit 36dbbe3 into candlepin:main Sep 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Tests error with missing module 'test'

2 participants