treewide: pytestFlagsArray -> pytestFlags and join flag and option argument#416213
treewide: pytestFlagsArray -> pytestFlags and join flag and option argument#416213wolfgangwalther merged 4 commits intoNixOS:stagingfrom
Conversation
There was a problem hiding this comment.
Should this be -ppytester then?
There was a problem hiding this comment.
Unfortunately not. -p changes the way positional arguments are handled, similar to what the -f=file flag does to installables for nix commands.
Here's the pytest documentation: https://docs.pytest.org/en/stable/how-to/usage.html#early-loading-plugins
There was a problem hiding this comment.
I can't read from the docs why -ppytester doesn't work but all the -pno:... do work?
If one doesn't work, should we be consistent and never use it?
I mean.. I see the benefit for all the -W... options to put them into a single string. But actually for all the others I read, which includes -p and the famous -rfEs, I think this makes things worse. So maybe only do this for -W?
There was a problem hiding this comment.
You're right. I confused -p with another flag that behaves the way I described.
There was a problem hiding this comment.
I confused
-pwith another flag that behaves the way I described.
Now I recalled the flag that behaves this way.
It's --pyargs
There was a problem hiding this comment.
I see. Those are consistently kept as multiple arguments, so should be good.
02bb4bf to
2300382
Compare
2300382 to
9f17715
Compare
…gument This treewide change targets Python packages that specifies pytest flags with pytestFlagsArray, and whose flags cannot be consructed by other pytestCheckHook-honoured arguments. Use the __structuredAttrs-agnostic argument pytestFlags instead of the deprecated pytestFlagsArray. For flags with option arguments, join each flag and their option argument into a single command-line argument following POSIX Utility Argument Syntax[1] for easier overriding (remove/replace). Examples: * [ "-W" "ignore:message:WarningClass" ] -> [ "-Wignore:message:WarningClass" ] * [ "--reruns" "3" ] -> [ "--reruns=3" ] [1]: https://pubs.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap12.html
9f17715 to
4945a86
Compare
|
Thank you! |
This treewide change targets Python packages that specifies pytest flags with pytestFlagsArray, and whose flags cannot be consructed by other pytestCheckHook-honoured arguments.
Use the __structuredAttrs-agnostic argument pytestFlags instead of the deprecated pytestFlagsArray.
For flags with option arguments, join each flag and their option argument into a single command-line argument following POSIX Utility Argument Syntax for easier overriding (remove/replace).
Examples:
[ "-W" "ignore:message:WarningClass" ]->[ "-Wignore:message:WarningClass" ][ "--reruns" "3" ]->[ "--reruns=3" ]Things done
nix.conf? (See Nix manual)sandbox = relaxedsandbox = truenix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)Add a 👍 reaction to pull requests you find important.