-
-
Notifications
You must be signed in to change notification settings - Fork 372
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
Make zope
a semi-optional test dependency
#685
Conversation
Would you mind inverting the logic and just make the Zope tests conditional on the presence of Zope.interface? That seems to be the more common approach nowadays anyways. |
Yeah, that's easy enough — the main difference between that approach and this one is that with this approach, it would be very hard to accidentally disable the zope-related tests, whereas if you always disable the zope-related testing whenever I figured this is a niche enough thing to want that it's better to require enthusiastic opt-in, but maybe it's not that big a deal if these tests sometimes get accidentally disabled in downstream testers? |
I don’t think anybody cares at all TBH. We’re just dragging it along for backward-compat. |
For the admittedly small number of people who don't care about support for `zope.interface`, it is unnecessary extra work to support even a test-only dependency on `zope`. The `zope`-specific tests are relatively contained, however, and with judicious use of pytest fixtures, we can make it so that `zope` is not a required dependency when skipping tests marked with `pytest.mark.zope`. This allows users to test everything but the `zope`-specific tests with no `zope` dependency with: $ TOX_AP_TEST_EXTRAS="tests_no_zope" tox -e <env> -- -m 'not zope'
This is a little more error-prone, but it's much more convenient to invoke, since it doesn't involve skipping the "zope" marker.
573e58d
to
5f696a0
Compare
OK, I've changed it to an auto-skipping fixture and added some docstrings and a changelog. If you think there's somewhere else that this should be explicitly documented, let me know. It didn't seem like it would fit much into |
Thanks! |
For the admittedly small number of people who don't care about support for
zope.interface
, it is unnecessary extra work to support even a test-only dependency onzope
.The
zope
-specific tests are relatively contained, however, and with judicious use of pytest fixtures, we can make it so thatzope
is not a required dependency when skipping tests marked withpytest.mark.zope
.This allows users to test everything but the
zope
-specific tests with nozope
dependency with:I realize that this is unusual and maybe not a maintenance burden you want to carry upstream, but it would smooth the process of importing
attrs
upstream into a certain large company's monorepo... I'm fine with a response that's basically "Enough with your weird nonsense, Paul".I didn't bother with documentation or a news fragment yet because I figured there's a high likelihood that this wouldn't be accepted.
Pull Request Check List
changelog.d
.