python3Packages: transition from pytestFlagsArray (2nd round) (#452102)

This commit is contained in:
Yueh-Shun Li
2026-04-26 18:35:58 +00:00
committed by GitHub
11 changed files with 25 additions and 19 deletions
@@ -214,10 +214,13 @@ buildPythonPackage (finalAttrs: {
"test_muster_specific_targets_with_dependencies"
];
# in order to use pytest marker, we need to use ppytestFlagsArray
# using pytestFlags causes `ERROR: file or directory not found: slow`
pytestFlagsArray = [
"-m='not slow and not not_in_ci and not regression'"
disabledTestMarks = [
"slow"
"not_in_ci"
"regression"
];
pytestFlags = [
"--timeout=10" # any test taking long, timouts with more than 60s
"--benchmark-disable"
"--tb=line"
@@ -36,9 +36,9 @@ buildPythonPackage rec {
enabledTestPaths = [ "tests/unit" ];
pytestFlagsArray = [
pytestFlags = [
# pyproject.toml specifies -n auto which only pytest-xdist understands
"--override-ini addopts=''"
"--override-ini=addopts="
];
pythonImportsCheck = [ "dbt.adapters.snowflake" ];
@@ -47,7 +47,7 @@ buildPythonPackage (finalAttrs: {
];
# tries to write to source directory otherwise:
pytestFlagsArray = [ "-p no:cacheprovider" ];
pytestFlags = [ "-pno:cacheprovider" ];
meta = {
inherit (hydra-core.meta) changelog license;
@@ -59,7 +59,7 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [ "tests/unit_tests" ];
enabledTestPaths = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_experimental" ];
@@ -46,7 +46,7 @@ buildPythonPackage rec {
numpy
];
pytestFlagsArray = [ "-v" ];
pytestFlags = [ "-v" ];
pythonImportsCheck = [
"mpl_typst"
@@ -120,7 +120,7 @@ buildPythonPackage (finalAttrs: {
tensorflow
];
pytestFlagsArray = [
pytestFlags = [
# FutureWarning: functools.partial will be a method descriptor in future Python versions; wrap it in enum.member() if you want to preserve the old behavior
"-Wignore::FutureWarning"
];
@@ -45,7 +45,7 @@ buildPythonPackage rec {
postgresql
];
pytestFlagsArray = [ "-vvv" ];
pytestFlags = [ "-vvv" ];
env = {
PGDATABASE = "_test_db";
@@ -52,11 +52,11 @@ buildPythonPackage rec {
})
];
pytestFlagsArray = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
disabledTestPaths = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) [
# AssertionError: Arrays are not almost equal to 6 decimals
"--deselect=tests/distributions/test_normal_full.py::test_fit"
"--deselect=tests/distributions/test_normal_full.py::test_from_summaries"
"--deselect=tests/distributions/test_normal_full.py::test_serialization"
"tests/distributions/test_normal_full.py::test_fit"
"tests/distributions/test_normal_full.py::test_from_summaries"
"tests/distributions/test_normal_full.py::test_serialization"
];
disabledTests = [
@@ -51,7 +51,7 @@ buildPythonPackage (finalAttrs: {
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [ "tests/test.py" ];
enabledTestPaths = [ "tests/test.py" ];
meta = {
homepage = "https://github.com/stef/liboprf/tree/master/python";
@@ -105,12 +105,15 @@ let
rm -r skimage
'';
pytestFlagsArray = [
"${installedPackageRoot}"
pytestFlags = [
"--pyargs"
"skimage"
];
enabledTestPaths = [
installedPackageRoot
];
disabledTestPaths = [
# Requires network access (actually some data is loaded via `skimage._shared.testing.fetch` in the global scope, which calls `pytest.skip` when a network is unaccessible, leading to a pytest collection error).
"${installedPackageRoot}/skimage/filters/rank/tests/test_rank.py"
@@ -290,7 +290,7 @@ buildPythonPackage {
++ optional-dependencies.api
++ optional-dependencies.similarity;
pytestFlagsArray = [
enabledTestPaths = [
"test/python/*"
];