Skip to content

Add pytest fixture to control optional dependency #26902

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

Open
TomAugspurger opened this issue Jun 17, 2019 · 0 comments
Open

Add pytest fixture to control optional dependency #26902

TomAugspurger opened this issue Jun 17, 2019 · 0 comments
Labels
Dependencies Required and optional dependencies Enhancement Testing pandas testing functions or related to the test suite

Comments

@TomAugspurger
Copy link
Contributor

When a method depends on an optional dependency, we want to test behavior that relies on it being installed & not installed. Right now, we have to add skips for both cases

  1. Test behavior when installed, skip if not installed
  2. Test behavior when not installed, skip if installed

Ideally, we would always test the second, by simulating a missing dependency. Unfortunately, python's caching of imports makes this somewhat difficult to achieve. Hopefully it doesn't require writing a custom importer: https://docs.python.org/3/library/importlib.html#introduction

@TomAugspurger TomAugspurger added Dependencies Required and optional dependencies Testing pandas testing functions or related to the test suite labels Jun 17, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Dependencies Required and optional dependencies Enhancement Testing pandas testing functions or related to the test suite
Projects
None yet
Development

No branches or pull requests

2 participants