-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
PYTEST_CURRENT_TEST explodes on windows where the env var limit is 32767 bytes #2951
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
Comments
@jonathanunderwood @nicoddemus i believe its a bug that we simply escape random binary data - we really should use a auto-id there at least |
Thanks - can confirm that setting ids fixes the immediate issue. It would be great for users if this was handled more gracefully by pytest. Some things spring to mind:
|
If ids are not specified for fixture params then pytest embeds them directly in the PYTEST_CURRENT_TEST environment variable. This causes problems when those parameters are large, as data is, particularly on MS Windows where env vars are limited to 32 kB in length. pytest-dev/pytest#2951
altering the id on the exception is not possible as its set in stone bytheon auto-generating the ids is what should happen, however in order to ensure better test id comprehension we do try to use a text representation if sensible, the case you are hitting is where we use a string representation where it is certainly not sensible i have no opinion on adding a option/flag for this - i defer to @nicoddemus on that one |
Duplicate of #6881 (closing this one because the other already has a PR associated with it) |
pip list
of the virtual environment you are usingI have a fixture defined like this:
This causes problems on Windows whenever a test uses that fixture, because pytest tries to stuff the parameter values into PYTEST_CURRENT_TEST, and the value of data is large such that the PYTEST_CURRENT_TEST env var would end up being larger than the maximum allowed size on windows (32767 bytes). Here's an example failure (on appveyor):
I think what's needed is some way of saying to pytest "use this alias for this parameter value when composing PYTEST_CURRENT_TEST", or "don't set PYTEST_CURRENT_TEST".
The text was updated successfully, but these errors were encountered: