pytestCheckHook: support __structuredAttrs
Add flag pytestFlags as the new, conforming interface replacing pytestFlagsArray. Stop Bash-expanding disabledTests and disabledTestPaths. Handle disabledTestPaths with `pytest --ignore-glob <path>` to keep globbing support. Check if each path glob matches at least one path using the `glob` module from the Python standard library. Also make buildPythonPackage and buildPythonApplication stop escaping the elements of disabledTests and disabledTestPaths.
This commit is contained in:
@@ -106,6 +106,7 @@ let
|
||||
"format"
|
||||
"disabledTestPaths"
|
||||
"disabledTests"
|
||||
"pytestFlags"
|
||||
"pytestFlagsArray"
|
||||
"unittestFlagsArray"
|
||||
"outputs"
|
||||
@@ -434,13 +435,14 @@ let
|
||||
}
|
||||
// optionalAttrs (attrs.doCheck or true) (
|
||||
optionalAttrs (disabledTestPaths != [ ]) {
|
||||
disabledTestPaths = escapeShellArgs disabledTestPaths;
|
||||
disabledTestPaths = disabledTestPaths;
|
||||
}
|
||||
// optionalAttrs (attrs ? disabledTests) {
|
||||
# `escapeShellArgs` should be used as well as `disabledTestPaths`,
|
||||
# but some packages rely on existing raw strings.
|
||||
disabledTests = attrs.disabledTests;
|
||||
}
|
||||
// optionalAttrs (attrs ? pytestFlags) {
|
||||
pytestFlags = attrs.pytestFlags;
|
||||
}
|
||||
// optionalAttrs (attrs ? pytestFlagsArray) {
|
||||
pytestFlagsArray = attrs.pytestFlagsArray;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user