-
-
Notifications
You must be signed in to change notification settings - Fork 9
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
Pytest variable not detected? #178
Comments
I think that the problem is that Maybe it is somehow reset? |
My theory is that pytest injects this variable after the plug in evaluates it. I don't know how I could go about testing if that's the case. |
Maybe you can do something like this? # Makefile
test_unit:
TEST_TYPE=unit pytest tests/unit
test_integration:
TEST_TYPE=integration pytest tests/integration And then use |
At the moment, I execute the scripts via a bash script and I export a variable (like I mentioned in #179) |
Hello,
I'm trying to get this plugin to work so that I can exclude integration tests from coverage when running unit tests, and vice-versa.
My integration tests sit in
tests/integration
while unit tests are intests/unit
.My plan was to use the
PYTEST_CURRENT_TEST
environment variable that pytest automatically creates to make this distinction.However, the rules seem to evaluated before the variable is introduced. I get the error below:
Confusingly, this snippet prints the variable value though:
FYI, the output of the above snippet:
and my
.coveragerc
:The text was updated successfully, but these errors were encountered: