Skip to content

Fix CLI test skipping under pytest >= 9.1 - #141

Merged
codingjoe merged 1 commit into
codingjoe:mainfrom
lukegb:pytest91-cli-test-skipping
Aug 4, 2026
Merged

Fix CLI test skipping under pytest >= 9.1#141
codingjoe merged 1 commit into
codingjoe:mainfrom
lukegb:pytest91-cli-test-skipping

Conversation

@lukegb

@lukegb lukegb commented Aug 1, 2026

Copy link
Copy Markdown
Contributor

pytest 9.1 changed the behaviour of "importorskip" to only ignore ModuleNotFoundError
(https://docs.pytest.org/en/stable/reference/reference.html#pytest-importorskip). ImportError is no longer ignored by default , so if click isn't installed then when ssdp/main.py raises ImportError we fail the test rather than skipping it as intended.

pytest 9.1 changed the behaviour of "importorskip" to only ignore
ModuleNotFoundError
(https://docs.pytest.org/en/stable/reference/reference.html#pytest-importorskip).
ImportError is no longer ignored by default , so if click isn't
installed then when ssdp/__main__.py raises ImportError we fail the test
rather than skipping it as intended.

@codingjoe codingjoe left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Thanks @lukegb, I appreciate the support :)

@codingjoe
codingjoe merged commit e4a545b into codingjoe:main Aug 4, 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.

2 participants