Skip to content
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

Fix tests that require pkg_resources #1301

Merged
merged 2 commits into from
Oct 8, 2020

Conversation

mdickinson
Copy link
Member

Three of the tests require the pkg_resources package to be present in the environment. It usually will be (since it's a part of the setuptools distribution), but if it's not, then the tests should be skipped rather than causing the test run to fail.

This PR fixes that, adding pkg_resources to the existing optional imports machinery in traits.testing.

Part of the motivation here is to be able to create a test run that validates that Traits doesn't have any "accidental" dependencies. See #1299.

Closes #1300.

@mdickinson
Copy link
Member Author

I tested this locally with the following steps, executed from the top level of a clean clone:

% python -m venv --clear ~/.venvs/traits
% source ~/.venvs/traits/bin/activate
% python -m pip install --upgrade pip setuptools wheel
% python -m pip install .
% python -m pip uninstall setuptools wheel
% mkdir temp
% cd temp
% python -m unittest discover -v traits

Copy link
Contributor

@rahulporuri rahulporuri left a comment

Choose a reason for hiding this comment

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

LGTM assuming CI is also happy

@mdickinson mdickinson merged commit a0d0a70 into master Oct 8, 2020
@mdickinson mdickinson deleted the fix/tests-should-not-require-pkg-resources branch October 8, 2020 09:43
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.

Skip tests that depend on pkg_resources if pkg_resources not present
2 participants