Skip to content

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

Open
prownd wants to merge 1 commit into
candlepin:mainfrom
prownd:tests-do-not-depend-on-CPython-s-test-package-s01
Open

tests: do not depend on CPython's 'test' package#51
prownd wants to merge 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

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
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'

1 participant