I'm going to preface this by acknowledging that it...
# general
I'm going to preface this by acknowledging that it's a weird question: Is there a way to specify different sets of
configuration declaratively (or even non-declaratively!) for different subsets of tests? Something like having different extra-requirements (https://www.pantsbuild.org/docs/reference-pytest#section-extra-requirements) for unit tests vs. integration tests?
(Chris's teammate here: We are thinking of doing --pytest-args="--no-cov")
👋 1
Yeah, that's probably the route we're going to end up going, but now I'm curious about the general case of different configurations for different segments of code... seems like a potentially interesting pattern 😄
The current way you do that is:
Alternatively, if you only want to install the plugin for certain tests, you can add the plugin to the dependencies field of your python_test / python_tests target. See Third-party dependencies for how to install Python dependencies. For example:
https://www.pantsbuild.org/docs/python-test-goal#pytest-version-and-plugins Will that work for you?
And then you can leverage
to dynamically change Pytest options etc on a per-test basis, iiuc
Ah, interesting! Thanks! We'll probably stick with
, but I'll keep this in mind for the future.
❤️ 1
I don't think I follow the
thing - is that to turn off coverage for all tests?
Yeah... it's really more of a peculiarity with our current testing setup, though.
Want to keep coverage for unit tests, but disable it for integration / end-to-end tests.