Skip to content

Skip tests that depend on lxml if not installed #12813

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 19, 2022
Merged

Skip tests that depend on lxml if not installed #12813

merged 1 commit into from
May 19, 2022

Conversation

emmatyping
Copy link
Member

@emmatyping emmatyping commented May 19, 2022

Description

Detect if lxml is importable in the test suite, if it is not, then skip the report tests which depend on it.

This is useful for enabling CI on new Python versions that may not have lxml wheels yet.

Test Plan

To test this I uninstalled lxml and was able to see pytest mypy/test/testcheck.py::TypeCheckSuite::check-reports.test skip all the tests.

Closes #11662

Copy link
Collaborator

@JukkaL JukkaL left a comment

Choose a reason for hiding this comment

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

Thanks! This will help with running tests on development versions of Python.

@JukkaL JukkaL merged commit 7f4f5b8 into master May 19, 2022
@JukkaL JukkaL deleted the nolxml branch May 19, 2022 15:02
hauntsaninja added a commit to hauntsaninja/mypy that referenced this pull request Jul 15, 2022
See mypyc/mypy_mypyc-wheels#35 for motivation

We also need fewer lxml workarounds, since python#12813 skips lxml tests
if needed

This is a bit of a pain to test since the script was moved into the
mypy repo from the wheels repo
hauntsaninja added a commit that referenced this pull request Jul 16, 2022
See mypyc/mypy_mypyc-wheels#35 for motivation

We also need fewer lxml workarounds, since #12813 skips lxml tests
if needed

This is a bit of a pain to test since the script was moved into the
mypy repo from the wheels repo
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.

Meta issue: improving test runner
2 participants