treewide: modernize Python package pytest flags

Use `(enabled|disabled)(TestPaths|TestMarks|Tests)` and `pytestFlags`
instead of the `__structuredAttrs`-incompatible `pytestFlagsArray`.
This commit is contained in:
Yueh-Shun Li 2025-06-16 03:54:55 +08:00
parent 7bca6ea942
commit 624897829b
202 changed files with 958 additions and 815 deletions

View File

@ -79,11 +79,14 @@ python3Packages.buildPythonApplication {
pytestCheckHook
];
pytestFlagsArray = [
# fails on ofborg because of lack of cpu vendor information
"--deselect=tests/controller/gns3vm/test_virtualbox_gns3_vm.py::test_cpu_vendor_id"
pytestFlags = [
# Rerun failed tests up to three times (flaky tests)
"--reruns 3"
"--reruns=3"
];
disabledTestPaths = [
# fails on ofborg because of lack of cpu vendor information
"tests/controller/gns3vm/test_virtualbox_gns3_vm.py::test_cpu_vendor_id"
];
passthru.tests = {

View File

@ -105,11 +105,13 @@ python3.pkgs.buildPythonApplication rec {
export PATH="$PATH:$out/bin:${lib.makeBinPath [ git ]}"
'';
pytestFlagsArray = [
"tests"
pytestFlags = [
# Disable warnings
"-W"
"ignore::DeprecationWarning"
"-Wignore::DeprecationWarning"
];
enabledTestPaths = [
"tests"
];
disabledTestPaths = [

View File

@ -51,7 +51,7 @@ python3.pkgs.buildPythonApplication rec {
];
# errbot-backend-slackv3 has not been packaged
pytestFlagsArray = [ "--ignore=tests/backend_tests/slack_test.py" ];
disabledTestPaths = [ "tests/backend_tests/slack_test.py" ];
disabledTests = [
# require networking

View File

@ -36,13 +36,13 @@ python3Packages.buildPythonApplication {
"test_init"
];
pytestFlagsArray = [
disabledTestPaths = [
# requires network access
"--ignore=test/test_results.py"
"--ignore=test/test_downloader.py"
"test/test_results.py"
"test/test_downloader.py"
# incompatible with pytestCheckHook
"--ignore=test/test_ytdl.py"
"test/test_ytdl.py"
];
pythonImportsCheck = [ "gallery_dl" ];

View File

@ -72,34 +72,6 @@ python3Packages.buildPythonApplication rec {
versionCheckProgramArg = "--version";
pytestFlagsArray =
[
# AssertionError on the version metadata
# https://github.com/pypa/hatch/issues/1877
"--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_all"
"--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_license_expression"
"--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_all"
"--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_license_expression"
"--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_all"
"--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_expression"
"--deselect=tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_files"
"--deselect=tests/backend/metadata/test_spec.py::TestProjectMetadataFromCoreMetadata::test_license_files"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Dependency/versioning errors in the CLI tests, only seem to show up on Darwin
# https://github.com/pypa/hatch/issues/1893
"--deselect=tests/cli/env/test_create.py::test_sync_dependencies_pip"
"--deselect=tests/cli/env/test_create.py::test_sync_dependencies_uv"
"--deselect=tests/cli/project/test_metadata.py::TestBuildDependenciesMissing::test_no_compatibility_check_if_exists"
"--deselect=tests/cli/run/test_run.py::TestScriptRunner::test_dependencies"
"--deselect=tests/cli/run/test_run.py::TestScriptRunner::test_dependencies_from_tool_config"
"--deselect=tests/cli/run/test_run.py::test_dependency_hash_checking"
"--deselect=tests/cli/run/test_run.py::test_sync_dependencies"
"--deselect=tests/cli/run/test_run.py::test_sync_project_dependencies"
"--deselect=tests/cli/run/test_run.py::test_sync_project_features"
"--deselect=tests/cli/version/test_version.py::test_no_compatibility_check_if_exists"
];
disabledTests =
[
# AssertionError: assert (1980, 1, 2, 0, 0, 0) == (2020, 2, 2, 0, 0, 0)
@ -157,6 +129,17 @@ python3Packages.buildPythonApplication rec {
# https://github.com/pypa/hatch/issues/1850
"tests/backend/licenses/test_parse.py"
"tests/backend/licenses/test_supported.py"
# AssertionError on the version metadata
# https://github.com/pypa/hatch/issues/1877
"tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_all"
"tests/backend/metadata/test_spec.py::TestCoreMetadataV21::test_license_expression"
"tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_all"
"tests/backend/metadata/test_spec.py::TestCoreMetadataV22::test_license_expression"
"tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_all"
"tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_expression"
"tests/backend/metadata/test_spec.py::TestCoreMetadataV23::test_license_files"
"tests/backend/metadata/test_spec.py::TestProjectMetadataFromCoreMetadata::test_license_files"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# AssertionError: assert [call('test h...2p32/bin/sh')] == [call('test h..., shell=True)]
@ -165,6 +148,19 @@ python3Packages.buildPythonApplication rec {
# != call('test hatch-test.py3.10', shell=True)
"tests/cli/fmt/test_fmt.py"
"tests/cli/test/test_test.py"
# Dependency/versioning errors in the CLI tests, only seem to show up on Darwin
# https://github.com/pypa/hatch/issues/1893
"tests/cli/env/test_create.py::test_sync_dependencies_pip"
"tests/cli/env/test_create.py::test_sync_dependencies_uv"
"tests/cli/project/test_metadata.py::TestBuildDependenciesMissing::test_no_compatibility_check_if_exists"
"tests/cli/run/test_run.py::TestScriptRunner::test_dependencies"
"tests/cli/run/test_run.py::TestScriptRunner::test_dependencies_from_tool_config"
"tests/cli/run/test_run.py::test_dependency_hash_checking"
"tests/cli/run/test_run.py::test_sync_dependencies"
"tests/cli/run/test_run.py::test_sync_project_dependencies"
"tests/cli/run/test_run.py::test_sync_project_features"
"tests/cli/version/test_version.py::test_no_compatibility_check_if_exists"
];
passthru = {

View File

@ -45,19 +45,22 @@ python3.pkgs.buildPythonApplication rec {
pytestCheckHook
];
pytestFlagsArray =
enabledTestPaths = [
# Only execute unittests, because cli tests require a running Redis
"tests/unittests/"
];
disabledTestPaths =
[
# Fails on sandbox
"--ignore=tests/unittests/test_client.py"
"--deselect=tests/unittests/test_render_functions.py::test_render_unixtime_config_raw"
"--deselect=tests/unittests/test_render_functions.py::test_render_time"
# Only execute unittests, because cli tests require a running Redis
"tests/unittests/"
"tests/unittests/test_client.py"
"tests/unittests/test_render_functions.py::test_render_unixtime_config_raw"
"tests/unittests/test_render_functions.py::test_render_time"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# Flaky tests
"--deselect=tests/unittests/test_entry.py::test_command_shell_options_higher_priority"
"--deselect=tests/unittests/test_utils.py::test_timer"
"tests/unittests/test_entry.py::test_command_shell_options_higher_priority"
"tests/unittests/test_utils.py::test_timer"
];
pythonImportsCheck = [ "iredis" ];

View File

@ -44,9 +44,12 @@ python3.pkgs.buildPythonApplication rec {
"test_singleschema"
];
pytestFlagsArray = [
pytestFlags = [
"-x"
"-svv"
];
enabledTestPaths = [
"tests"
];

View File

@ -149,11 +149,11 @@ python.pkgs.buildPythonApplication rec {
++ (providerPackages.jellyfin python.pkgs)
++ (providerPackages.opensubsonic python.pkgs);
pytestFlagsArray = [
disabledTestPaths = [
# blocks in poll()
"--deselect=tests/providers/jellyfin/test_init.py::test_initial_sync"
"--deselect=tests/core/test_server_base.py::test_start_and_stop_server"
"--deselect=tests/core/test_server_base.py::test_events"
"tests/providers/jellyfin/test_init.py::test_initial_sync"
"tests/core/test_server_base.py::test_start_and_stop_server"
"tests/core/test_server_base.py::test_events"
];
pythonImportsCheck = [ "music_assistant" ];

View File

@ -51,8 +51,11 @@ python.pkgs.buildPythonApplication rec {
mdit-py-plugins
];
pytestFlagsArray = [
pytestFlags = [
"-vvrP"
];
enabledTestPaths = [
"tests/"
];

View File

@ -101,7 +101,7 @@ python.pkgs.buildPythonApplication rec {
pytest-httpserver
];
pytestFlagsArray = [ "-m 'not network'" ];
disabledTestMarks = [ "network" ];
preCheck = ''
export HOME=$TMPDIR

View File

@ -147,8 +147,8 @@ buildPythonPackage rec {
"test_threading_atomic_cached_property_different_instances"
];
pytestFlagsArray = [
"-m 'not network'"
disabledTestMarks = [
"network"
];
# Allow for package to use pep420's native namespaces

View File

@ -52,7 +52,7 @@ python3Packages.buildPythonApplication rec {
]
++ [ dpkg ];
pytestFlagsArray = [ "tests/unit" ];
enabledTestPaths = [ "tests/unit" ];
disabledTests = [
"test_project_all_platforms_invalid"

View File

@ -66,9 +66,8 @@ python3.pkgs.buildPythonApplication rec {
pythonRelaxDeps = [ "stem" ];
pytestFlagsArray = [
"-m"
"'not online'"
disabledTestMarks = [
"online"
];
meta = {

View File

@ -26,9 +26,9 @@ python3Packages.buildPythonApplication rec {
nativeCheckInputs = with python3Packages; [ pytestCheckHook ];
pytestFlagsArray = [
disabledTestPaths = [
# we are not interested in linting the project
"--ignore=tests/test_codingstyle.py"
"tests/test_codingstyle.py"
];
meta = with lib; {

View File

@ -59,8 +59,11 @@ buildPythonApplication {
requests-mock
];
pytestFlagsArray = [
pytestFlags = [
"--doctest-modules"
];
enabledTestPaths = [
"lib"
];

View File

@ -26,7 +26,7 @@ let
input: (input.pname or null) != "pytest-twisted"
) oldAttrs.nativeCheckInputs;
pytestFlagsArray = null;
doCheck = false;
});
};
};

View File

@ -49,7 +49,7 @@ python3Packages.buildPythonApplication rec {
postBuild = "make -C doc";
pytestFlagsArray = [ "src/vulnix" ];
enabledTestPaths = [ "src/vulnix" ];
postInstall = ''
install -D -t $doc/share/doc/vulnix README.rst CHANGES.rst

View File

@ -59,10 +59,10 @@ python3Packages.buildPythonApplication rec {
"test_thumbnail"
];
pytestFlagsArray = [
disabledTestPaths = [
# According to documentation, e2e tests can be flaky:
# "This checksum can be inaccurate for end-to-end tests"
"--ignore=tests/e2e"
"tests/e2e"
];
passthru.updateScript = ./update.sh;

View File

@ -117,6 +117,10 @@ buildPythonApplication rec {
--fish <(_PIO_COMPLETE=fish_source $out/bin/pio)
'';
enabledTestPaths = [
"tests"
];
disabledTestPaths = [
"tests/commands/pkg/test_install.py"
"tests/commands/pkg/test_list.py"
@ -131,8 +135,66 @@ buildPythonApplication rec {
"tests/commands/test_run.py"
"tests/commands/test_test.py"
"tests/misc/test_maintenance.py"
# requires internet connection
"tests/misc/ino2cpp/test_ino2cpp.py"
"commands/pkg/test_exec.py::test_pkg_specified"
"commands/pkg/test_exec.py::test_unrecognized_options"
"commands/test_ci.py::test_ci_boards"
"commands/test_ci.py::test_ci_build_dir"
"commands/test_ci.py::test_ci_keep_build_dir"
"commands/test_ci.py::test_ci_lib_and_board"
"commands/test_ci.py::test_ci_project_conf"
"commands/test_init.py::test_init_custom_framework"
"commands/test_init.py::test_init_duplicated_boards"
"commands/test_init.py::test_init_enable_auto_uploading"
"commands/test_init.py::test_init_ide_atom"
"commands/test_init.py::test_init_ide_clion"
"commands/test_init.py::test_init_ide_eclipse"
"commands/test_init.py::test_init_ide_vscode"
"commands/test_init.py::test_init_incorrect_board"
"commands/test_init.py::test_init_special_board"
"commands/test_lib.py::test_global_install_archive"
"commands/test_lib.py::test_global_install_registry"
"commands/test_lib.py::test_global_install_repository"
"commands/test_lib.py::test_global_lib_list"
"commands/test_lib.py::test_global_lib_uninstall"
"commands/test_lib.py::test_global_lib_update"
"commands/test_lib.py::test_global_lib_update_check"
"commands/test_lib.py::test_install_duplicates"
"commands/test_lib.py::test_lib_show"
"commands/test_lib.py::test_lib_stats"
"commands/test_lib.py::test_saving_deps"
"commands/test_lib.py::test_search"
"commands/test_lib.py::test_update"
"commands/test_lib_complex.py::test_global_install_archive"
"commands/test_lib_complex.py::test_global_install_registry"
"commands/test_lib_complex.py::test_global_install_repository"
"commands/test_lib_complex.py::test_global_lib_list"
"commands/test_lib_complex.py::test_global_lib_uninstall"
"commands/test_lib_complex.py::test_global_lib_update"
"commands/test_lib_complex.py::test_global_lib_update_check"
"commands/test_lib_complex.py::test_install_duplicates"
"commands/test_lib_complex.py::test_lib_show"
"commands/test_lib_complex.py::test_lib_stats"
"commands/test_lib_complex.py::test_search"
"package/test_manager.py::test_download"
"package/test_manager.py::test_install_force"
"package/test_manager.py::test_install_from_registry"
"package/test_manager.py::test_install_lib_depndencies"
"package/test_manager.py::test_registry"
"package/test_manager.py::test_uninstall"
"package/test_manager.py::test_update_with_metadata"
"package/test_manager.py::test_update_without_metadata"
"test_builder.py::test_build_flags"
"test_builder.py::test_build_unflags"
"test_builder.py::test_debug_custom_build_flags"
"test_builder.py::test_debug_default_build_flags"
"test_misc.py::test_api_cache"
"test_misc.py::test_ping_internet_ips"
"test_misc.py::test_platformio_cli"
"test_pkgmanifest.py::test_packages"
];
disabledTests = [
@ -142,69 +204,6 @@ buildPythonApplication rec {
"test_metadata_dump"
];
pytestFlagsArray =
[
"tests"
]
++ (map (e: "--deselect tests/${e}") [
"commands/pkg/test_exec.py::test_pkg_specified"
"commands/pkg/test_exec.py::test_unrecognized_options"
"commands/test_ci.py::test_ci_boards"
"commands/test_ci.py::test_ci_build_dir"
"commands/test_ci.py::test_ci_keep_build_dir"
"commands/test_ci.py::test_ci_lib_and_board"
"commands/test_ci.py::test_ci_project_conf"
"commands/test_init.py::test_init_custom_framework"
"commands/test_init.py::test_init_duplicated_boards"
"commands/test_init.py::test_init_enable_auto_uploading"
"commands/test_init.py::test_init_ide_atom"
"commands/test_init.py::test_init_ide_clion"
"commands/test_init.py::test_init_ide_eclipse"
"commands/test_init.py::test_init_ide_vscode"
"commands/test_init.py::test_init_incorrect_board"
"commands/test_init.py::test_init_special_board"
"commands/test_lib.py::test_global_install_archive"
"commands/test_lib.py::test_global_install_registry"
"commands/test_lib.py::test_global_install_repository"
"commands/test_lib.py::test_global_lib_list"
"commands/test_lib.py::test_global_lib_uninstall"
"commands/test_lib.py::test_global_lib_update"
"commands/test_lib.py::test_global_lib_update_check"
"commands/test_lib.py::test_install_duplicates"
"commands/test_lib.py::test_lib_show"
"commands/test_lib.py::test_lib_stats"
"commands/test_lib.py::test_saving_deps"
"commands/test_lib.py::test_search"
"commands/test_lib.py::test_update"
"commands/test_lib_complex.py::test_global_install_archive"
"commands/test_lib_complex.py::test_global_install_registry"
"commands/test_lib_complex.py::test_global_install_repository"
"commands/test_lib_complex.py::test_global_lib_list"
"commands/test_lib_complex.py::test_global_lib_uninstall"
"commands/test_lib_complex.py::test_global_lib_update"
"commands/test_lib_complex.py::test_global_lib_update_check"
"commands/test_lib_complex.py::test_install_duplicates"
"commands/test_lib_complex.py::test_lib_show"
"commands/test_lib_complex.py::test_lib_stats"
"commands/test_lib_complex.py::test_search"
"package/test_manager.py::test_download"
"package/test_manager.py::test_install_force"
"package/test_manager.py::test_install_from_registry"
"package/test_manager.py::test_install_lib_depndencies"
"package/test_manager.py::test_registry"
"package/test_manager.py::test_uninstall"
"package/test_manager.py::test_update_with_metadata"
"package/test_manager.py::test_update_without_metadata"
"test_builder.py::test_build_flags"
"test_builder.py::test_build_unflags"
"test_builder.py::test_debug_custom_build_flags"
"test_builder.py::test_debug_default_build_flags"
"test_misc.py::test_api_cache"
"test_misc.py::test_ping_internet_ips"
"test_misc.py::test_platformio_cli"
"test_pkgmanifest.py::test_packages"
]);
passthru = {
python = python3Packages.python;
};

View File

@ -42,7 +42,7 @@ buildPythonPackage rec {
hypothesis
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
pythonImportsCheck = [ "ahocorasick_rs" ];

View File

@ -48,11 +48,8 @@ buildPythonPackage rec {
redisTestHook
] ++ lib.flatten (lib.attrValues optional-dependencies);
pytestFlagsArray = [
"-W"
"ignore::DeprecationWarning"
# TypeError: object MagicMock can't be used in 'await' expression
"--deselect=tests/ut/backends/test_redis.py::TestRedisBackend::test_close"
pytestFlags = [
"-Wignore::DeprecationWarning"
# Tests can time out and leave redis/valkey in an unusable state for later tests
"-x"
];
@ -77,6 +74,9 @@ buildPythonPackage rec {
"tests/performance/"
# Full of timing-sensitive tests
"tests/ut/backends/test_redis.py"
# TypeError: object MagicMock can't be used in 'await' expression
"tests/ut/backends/test_redis.py::TestRedisBackend::test_close"
];
__darwinAllowLocalNetworking = true;

View File

@ -34,9 +34,8 @@ buildPythonPackage rec {
pythonImportsCheck = [ "aiomqtt" ];
pytestFlagsArray = [
"-m"
"'not network'"
disabledTestMarks = [
"network"
];
meta = with lib; {

View File

@ -76,7 +76,7 @@ buildPythonPackage rec {
# Optionally disable pytest-xdist to make it easier to debug the test suite.
# Test suite takes ~5 minutes without pytest-xdist. Note that some tests will
# fail when running without pytest-xdist ("worker_id not found").
# pytestFlagsArray = [ "-o" "addopts=" ];
# pytestFlags = [ "-oaddopts=" ];
disabledTestPaths = [
# Tests that require scanpy, creating a circular dependency chain

View File

@ -75,11 +75,12 @@ buildPythonPackage rec {
uvloop
] ++ optional-dependencies.trio;
pytestFlagsArray = [
"-W"
"ignore::trio.TrioDeprecationWarning"
"-m"
"'not network'"
pytestFlags = [
"-Wignore::trio.TrioDeprecationWarning"
];
disabledTestMarks = [
"network"
];
preCheck = lib.optionalString stdenv.hostPlatform.isDarwin ''

View File

@ -44,9 +44,8 @@ buildPythonPackage rec {
pythonImportsCheck = [ "array_api_compat" ];
# CUDA (used via cupy) is not available in the testing sandbox
pytestFlagsArray = [
"-k"
"'not cupy'"
disabledTests = [
"cupy"
];
meta = {

View File

@ -84,13 +84,15 @@ buildPythonPackage rec {
zarr
];
pytestFlagsArray = [
enabledTestPaths = [
"arviz/tests/base_tests/"
];
disabledTestPaths = [
# AttributeError: module 'zarr.storage' has no attribute 'DirectoryStore'
# https://github.com/arviz-devs/arviz/issues/2357
"--deselect=arviz/tests/base_tests/test_data_zarr.py::TestDataZarr::test_io_function"
"--deselect=arviz/tests/base_tests/test_data_zarr.py::TestDataZarr::test_io_method"
"arviz/tests/base_tests/test_data_zarr.py::TestDataZarr::test_io_function"
"arviz/tests/base_tests/test_data_zarr.py::TestDataZarr::test_io_method"
];
disabledTests = [

View File

@ -75,11 +75,14 @@ buildPythonPackage rec {
export USE_ASYNCIO=1
'';
pytestFlagsArray = [
"--ignore=./autobahn/twisted"
enabledTestPaths = [
"./autobahn"
];
disabledTestPaths = [
"./autobahn/twisted"
];
pythonImportsCheck = [ "autobahn" ];
optional-dependencies = lib.fix (self: {

View File

@ -32,7 +32,7 @@ let
pytestCheckHook
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
# escape infinite recursion with twisted
doCheck = false;

View File

@ -57,9 +57,12 @@ buildPythonPackage rec {
export AWS_DEFAULT_REGION=us-east-1
'';
pytestFlagsArray = [
enabledTestPaths = [
"tests"
''-m "not slow"''
];
disabledTestMarks = [
"slow"
];
disabledTests = [

View File

@ -66,10 +66,6 @@ buildPythonPackage rec {
sqlalchemy
tabulate
];
pytestFlagsArray = [
# Hangs forever
"--deselect=ax/analysis/plotly/tests/test_top_surfaces.py::TestTopSurfacesAnalysis::test_online"
];
disabledTestPaths = [
"ax/benchmark"
@ -80,6 +76,9 @@ buildPythonPackage rec {
"ax/service/tests/test_ax_client.py"
"ax/service/tests/test_scheduler.py"
"ax/service/tests/test_with_db_settings_base.py"
# Hangs forever
"ax/analysis/plotly/tests/test_top_surfaces.py::TestTopSurfacesAnalysis::test_online"
];
disabledTests =

View File

@ -58,9 +58,9 @@ buildPythonPackage rec {
# Can not run memcached tests because it immediately tries to connect.
# Disable external tests because they need to connect to a live database.
pytestFlagsArray = [
"--ignore=tests/test_memcached.py"
"--ignore-glob='tests/test_managers/test_ext_*'"
disabledTestPaths = [
"tests/test_memcached.py"
"tests/test_managers/test_ext_*"
];
meta = {

View File

@ -31,7 +31,11 @@ buildPythonPackage rec {
regex
];
pytestFlagsArray = [ "--fixtures tests/" ];
pytestFlags = [ "--fixtures" ];
enabledTestPaths = [
"tests/"
];
pythonImportsCheck = [ "beancount" ];

View File

@ -58,7 +58,7 @@ buildPythonPackage rec {
pytest-benchmark
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
disabledTests = lib.optionals (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) [
# Segfaults: boost_histogram/_internal/hist.py", line 799 in sum

View File

@ -57,7 +57,7 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [ "-m 'not network'" ];
disabledTestMarks = [ "network" ];
disabledTests = [
# tries to call python -m bork

View File

@ -84,8 +84,11 @@ buildPythonPackage rec {
pytest-benchmark
] ++ lib.flatten (lib.attrValues optional-dependencies);
pytestFlagsArray = [
pytestFlags = [
"--benchmark-disable"
];
enabledTestPaths = [
"pytests"
];

View File

@ -58,9 +58,13 @@ buildPythonPackage rec {
pytestCheckHook
] ++ lib.flatten (builtins.attrValues optional-dependencies);
pytestFlagsArray = [
pytestFlags = [
# long_envvar_name_imports requires stable key value pair ordering
"-s src/canmatrix"
"-s"
];
enabledTestPaths = [
"src/canmatrix"
"tests/"
];

View File

@ -76,11 +76,14 @@ buildPythonPackage rec {
export HOME=$TMPDIR
'';
pytestFlagsArray = [
pytestFlags = [
"--pyargs"
"cartopy"
"-m"
"'not network and not natural_earth'"
];
disabledTestMarks = [
"network"
"natural_earth"
];
disabledTests = [

View File

@ -74,10 +74,13 @@ buildPythonPackage rec {
rm -r curl_cffi
'';
pytestFlags = [
enabledTestPaths = [
"tests/unittest"
];
disabledTestPaths = [
# test accesses network
"--deselect tests/unittest/test_smoke.py::test_async"
"tests/unittest/test_smoke.py::test_async"
];
disabledTests = [

View File

@ -112,11 +112,14 @@ buildPythonPackage rec {
++ optional-dependencies.dataframe;
versionCheckProgramArg = "--version";
pytestFlagsArray = [
pytestFlags = [
# Rerun failed tests up to three times
"--reruns 3"
"--reruns=3"
];
disabledTestMarks = [
# Don't run tests that require network access
"-m 'not network'"
"network"
];
disabledTests = [

View File

@ -87,13 +87,15 @@ buildPythonPackage rec {
trustme
];
pytestFlags = [
# datasette/app.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
"-Wignore::DeprecationWarning"
];
# takes 30-180 mins to run entire test suite, not worth the CPU resources, slows down reviews
# with pytest-xdist, it still takes around 10 mins with 32 cores
# just run the csv tests, as this should give some indictation of correctness
pytestFlagsArray = [
# datasette/app.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
"-W"
"ignore::DeprecationWarning"
enabledTestPaths = [
"tests/test_csv.py"
];

View File

@ -78,9 +78,12 @@ buildPythonPackage rec {
rm -rf deltalake
'';
pytestFlagsArray = [
pytestFlags = [
"--benchmark-disable"
"-m 'not integration'"
];
disabledTestMarks = [
"integration"
];
meta = with lib; {

View File

@ -73,39 +73,15 @@ buildPythonPackage rec {
scipy
];
pytestFlagsArray =
[
"-x"
# Tests marked as 'parallel' require mpi and fail in the sandbox:
# FileNotFoundError: [Errno 2] No such file or directory: 'mpiexec'
"-m 'not parallel'"
]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# assert np.all(f.data == check)
# assert Data(False)
"--deselect tests/test_data.py::TestDataReference::test_w_data"
pytestFlags = [
"-x"
];
# AssertionError: assert 'omp for schedule(dynamic,1)' == 'omp for coll...le(dynamic,1)'
"--deselect tests/test_dle.py::TestNestedParallelism::test_nested_cache_blocking_structure_subdims"
# codepy.CompileError: module compilation failed
# FAILED compiler invocation
"--deselect tests/test_dle.py::TestNodeParallelism::test_dynamic_nthreads"
# AssertionError: assert all(not i.pragmas for i in iters[2:])
"--deselect tests/test_dle.py::TestNodeParallelism::test_incr_perfect_sparse_outer"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# IndexError: tuple index out of range
"--deselect tests/test_dle.py::TestNestedParallelism"
# codepy.CompileError: module compilation failed
"--deselect tests/test_autotuner.py::test_nested_nthreads"
# assert np.all(np.isclose(f0.data, check0))
# assert Data(false)
"--deselect tests/test_interpolation.py::TestSubDomainInterpolation::test_inject_subdomain"
];
disabledTestMarks = [
# Tests marked as 'parallel' require mpi and fail in the sandbox:
# FileNotFoundError: [Errno 2] No such file or directory: 'mpiexec'
"parallel"
];
disabledTests =
[
@ -143,7 +119,33 @@ buildPythonPackage rec {
[
# Flaky: codepy.CompileError: module compilation failed
"tests/test_dse.py"
];
]
++ lib.optionals (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.isAarch64) [
# assert np.all(f.data == check)
# assert Data(False)
"tests/test_data.py::TestDataReference::test_w_data"
# AssertionError: assert 'omp for schedule(dynamic,1)' == 'omp for coll...le(dynamic,1)'
"tests/test_dle.py::TestNestedParallelism::test_nested_cache_blocking_structure_subdims"
# codepy.CompileError: module compilation failed
# FAILED compiler invocation
"tests/test_dle.py::TestNodeParallelism::test_dynamic_nthreads"
# AssertionError: assert all(not i.pragmas for i in iters[2:])
"tests/test_dle.py::TestNodeParallelism::test_incr_perfect_sparse_outer"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# IndexError: tuple index out of range
"tests/test_dle.py::TestNestedParallelism"
# codepy.CompileError: module compilation failed
"tests/test_autotuner.py::test_nested_nthreads"
# assert np.all(np.isclose(f0.data, check0))
# assert Data(false)
"tests/test_interpolation.py::TestSubDomainInterpolation::test_inject_subdomain"
];
pythonImportsCheck = [ "devito" ];

View File

@ -25,9 +25,9 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [
disabledTestMarks = [
# see https://github.com/ulif/diceware/commit/a7d844df76cd4b95a717f21ef5aa6167477b6733
"-m 'not packaging'"
"packaging"
];
pythonImportsCheck = [ "diceware" ];

View File

@ -55,12 +55,6 @@ buildPythonPackage rec {
doCheck = false; # some tests get stuck easily
pytestFlagsArray = [
"-W"
"ignore::DeprecationWarning"
"-m 'not slow'"
];
nativeCheckInputs = [
hypothesis
pexpect
@ -69,6 +63,14 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlags = [
"-Wignore::DeprecationWarning"
];
disabledTestMarks = [
"slow"
];
disabledTests = [
# AssertionError: assert '9.9012134805...5147838841057' == '2.7182818284...2178525166427'
"test_evalf_fast_series"

View File

@ -45,69 +45,69 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [
"--deselect=tests/test_customer.py::TestCustomer::test_customer_sync_unsupported_source"
"--deselect=tests/test_customer.py::TestCustomer::test_upcoming_invoice_plan"
"--deselect=tests/test_customer.py::TestCustomerLegacy::test_upcoming_invoice"
"--deselect=tests/test_event_handlers.py::TestCustomerEvents::test_customer_default_source_deleted"
"--deselect=tests/test_event_handlers.py::TestCustomerEvents::test_customer_deleted"
"--deselect=tests/test_event_handlers.py::TestCustomerEvents::test_customer_source_double_delete"
"--deselect=tests/test_event_handlers.py::TestPlanEvents::test_plan_created"
"--deselect=tests/test_event_handlers.py::TestPlanEvents::test_plan_deleted"
"--deselect=tests/test_event_handlers.py::TestPlanEvents::test_plan_updated_request_object"
"--deselect=tests/test_event_handlers.py::TestTaxIdEvents::test_tax_id_created"
"--deselect=tests/test_event_handlers.py::TestTaxIdEvents::test_tax_id_deleted"
"--deselect=tests/test_event_handlers.py::TestTaxIdEvents::test_tax_id_updated"
"--deselect=tests/test_invoice.py::InvoiceTest::test_upcoming_invoice"
"--deselect=tests/test_invoice.py::InvoiceTest::test_upcoming_invoice_with_subscription"
"--deselect=tests/test_invoice.py::InvoiceTest::test_upcoming_invoice_with_subscription_plan"
"--deselect=tests/test_invoice.py::TestInvoiceDecimal::test_decimal_tax_percent"
"--deselect=tests/test_plan.py::PlanCreateTest::test_create_from_djstripe_product"
"--deselect=tests/test_plan.py::PlanCreateTest::test_create_from_product_id"
"--deselect=tests/test_plan.py::PlanCreateTest::test_create_from_stripe_product"
"--deselect=tests/test_plan.py::PlanCreateTest::test_create_with_metadata"
"--deselect=tests/test_price.py::PriceCreateTest::test_create_from_djstripe_product"
"--deselect=tests/test_price.py::PriceCreateTest::test_create_from_product_id"
"--deselect=tests/test_price.py::PriceCreateTest::test_create_from_stripe_product"
"--deselect=tests/test_price.py::PriceCreateTest::test_create_with_metadata"
"--deselect=tests/test_settings.py::TestSubscriberModelRetrievalMethod::test_bad_callback"
"--deselect=tests/test_settings.py::TestSubscriberModelRetrievalMethod::test_no_callback"
"--deselect=tests/test_settings.py::TestStripeApiVersion::test_global_stripe_api_version"
"--deselect=tests/test_subscription.py::TestSubscriptionDecimal::test_decimal_application_fee_percent"
"--deselect=tests/test_tax_id.py::TestTaxIdStr::test___str__"
"--deselect=tests/test_tax_id.py::TestTransfer::test__api_create"
"--deselect=tests/test_tax_id.py::TestTransfer::test__api_create_no_customer"
"--deselect=tests/test_tax_id.py::TestTransfer::test__api_create_no_id_kwarg"
"--deselect=tests/test_tax_id.py::TestTransfer::test_api_list"
"--deselect=tests/test_tax_id.py::TestTransfer::test_api_retrieve"
"--deselect=tests/test_tax_rates.py::TestTaxRateDecimal::test_decimal_tax_percent"
"--deselect=tests/test_transfer_reversal.py::TestTransfer::test_api_list"
"--deselect=tests/test_transfer_reversal.py::TestTransfer::test_api_retrieve"
"--deselect=tests/test_usage_record.py::TestUsageRecord::test___str__"
"--deselect=tests/test_usage_record.py::TestUsageRecord::test__api_create"
"--deselect=tests/test_usage_record_summary.py::TestUsageRecordSummary::test___str__"
"--deselect=tests/test_usage_record_summary.py::TestUsageRecordSummary::test_api_list"
"--deselect=tests/test_usage_record_summary.py::TestUsageRecordSummary::test_sync_from_stripe_data"
"--deselect=tests/test_views.py::TestConfirmCustomActionView::test__cancel_subscription_instances_stripe_invalid_request_error"
"--deselect=tests/test_views.py::TestConfirmCustomActionView::test__release_subscription_schedule_stripe_invalid_request_error"
"--deselect=tests/test_views.py::TestConfirmCustomActionView::test__cancel_subscription_schedule_stripe_invalid_request_error"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test___str__"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_error"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_good_connect_account"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_good_platform_account"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_invalid_verify_signature_fail"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_no_signature"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_no_validation_pass"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_remote_addr_is_empty_string"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_remote_addr_is_none"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_reraise_exception"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_retrieve_event_fail"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_retrieve_event_pass"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_test_event"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_verify_signature_pass"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_with_custom_callback"
"--deselect=tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_with_transfer_event_duplicate"
"--deselect=tests/test_webhooks.py::TestGetRemoteIp::test_get_remote_ip_remote_addr_is_none"
disabledTestPaths = [
"tests/test_customer.py::TestCustomer::test_customer_sync_unsupported_source"
"tests/test_customer.py::TestCustomer::test_upcoming_invoice_plan"
"tests/test_customer.py::TestCustomerLegacy::test_upcoming_invoice"
"tests/test_event_handlers.py::TestCustomerEvents::test_customer_default_source_deleted"
"tests/test_event_handlers.py::TestCustomerEvents::test_customer_deleted"
"tests/test_event_handlers.py::TestCustomerEvents::test_customer_source_double_delete"
"tests/test_event_handlers.py::TestPlanEvents::test_plan_created"
"tests/test_event_handlers.py::TestPlanEvents::test_plan_deleted"
"tests/test_event_handlers.py::TestPlanEvents::test_plan_updated_request_object"
"tests/test_event_handlers.py::TestTaxIdEvents::test_tax_id_created"
"tests/test_event_handlers.py::TestTaxIdEvents::test_tax_id_deleted"
"tests/test_event_handlers.py::TestTaxIdEvents::test_tax_id_updated"
"tests/test_invoice.py::InvoiceTest::test_upcoming_invoice"
"tests/test_invoice.py::InvoiceTest::test_upcoming_invoice_with_subscription"
"tests/test_invoice.py::InvoiceTest::test_upcoming_invoice_with_subscription_plan"
"tests/test_invoice.py::TestInvoiceDecimal::test_decimal_tax_percent"
"tests/test_plan.py::PlanCreateTest::test_create_from_djstripe_product"
"tests/test_plan.py::PlanCreateTest::test_create_from_product_id"
"tests/test_plan.py::PlanCreateTest::test_create_from_stripe_product"
"tests/test_plan.py::PlanCreateTest::test_create_with_metadata"
"tests/test_price.py::PriceCreateTest::test_create_from_djstripe_product"
"tests/test_price.py::PriceCreateTest::test_create_from_product_id"
"tests/test_price.py::PriceCreateTest::test_create_from_stripe_product"
"tests/test_price.py::PriceCreateTest::test_create_with_metadata"
"tests/test_settings.py::TestSubscriberModelRetrievalMethod::test_bad_callback"
"tests/test_settings.py::TestSubscriberModelRetrievalMethod::test_no_callback"
"tests/test_settings.py::TestStripeApiVersion::test_global_stripe_api_version"
"tests/test_subscription.py::TestSubscriptionDecimal::test_decimal_application_fee_percent"
"tests/test_tax_id.py::TestTaxIdStr::test___str__"
"tests/test_tax_id.py::TestTransfer::test__api_create"
"tests/test_tax_id.py::TestTransfer::test__api_create_no_customer"
"tests/test_tax_id.py::TestTransfer::test__api_create_no_id_kwarg"
"tests/test_tax_id.py::TestTransfer::test_api_list"
"tests/test_tax_id.py::TestTransfer::test_api_retrieve"
"tests/test_tax_rates.py::TestTaxRateDecimal::test_decimal_tax_percent"
"tests/test_transfer_reversal.py::TestTransfer::test_api_list"
"tests/test_transfer_reversal.py::TestTransfer::test_api_retrieve"
"tests/test_usage_record.py::TestUsageRecord::test___str__"
"tests/test_usage_record.py::TestUsageRecord::test__api_create"
"tests/test_usage_record_summary.py::TestUsageRecordSummary::test___str__"
"tests/test_usage_record_summary.py::TestUsageRecordSummary::test_api_list"
"tests/test_usage_record_summary.py::TestUsageRecordSummary::test_sync_from_stripe_data"
"tests/test_views.py::TestConfirmCustomActionView::test__cancel_subscription_instances_stripe_invalid_request_error"
"tests/test_views.py::TestConfirmCustomActionView::test__release_subscription_schedule_stripe_invalid_request_error"
"tests/test_views.py::TestConfirmCustomActionView::test__cancel_subscription_schedule_stripe_invalid_request_error"
"tests/test_webhooks.py::TestWebhookEventTrigger::test___str__"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_error"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_good_connect_account"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_good_platform_account"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_invalid_verify_signature_fail"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_no_signature"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_no_validation_pass"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_remote_addr_is_empty_string"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_remote_addr_is_none"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_reraise_exception"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_retrieve_event_fail"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_retrieve_event_pass"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_test_event"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_verify_signature_pass"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_with_custom_callback"
"tests/test_webhooks.py::TestWebhookEventTrigger::test_webhook_with_transfer_event_duplicate"
"tests/test_webhooks.py::TestGetRemoteIp::test_get_remote_ip_remote_addr_is_none"
];
pythonImportsCheck = [ "djstripe" ];

View File

@ -33,8 +33,11 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [
pytestFlags = [
"--ds=crispy_forms.tests.test_settings"
];
enabledTestPaths = [
"crispy_forms/tests/"
];

View File

@ -99,7 +99,7 @@ buildPythonPackage rec {
"django_q/tests/test_commands.py"
];
pytestFlagsArray = [ "-vv" ];
pytestFlags = [ "-vv" ];
__darwinAllowLocalNetworking = true;

View File

@ -67,9 +67,8 @@ buildPythonPackage rec {
# https://github.com/jazzband/django-redis/issues/777
dontUsePytestXdist = true;
pytestFlagsArray = [
"-W"
"ignore::DeprecationWarning"
pytestFlags = [
"-Wignore::DeprecationWarning"
];
disabledTests = [

View File

@ -27,9 +27,9 @@ buildPythonPackage rec {
pythonImportsCheck = [ "dotwiz" ];
pytestFlagsArray = [
"--ignore=benchmarks"
"--ignore-glob=*integration*"
disabledTestPaths = [
"benchmarks"
"integration*"
];
meta = with lib; {

View File

@ -41,7 +41,7 @@ buildPythonPackage rec {
# We need to run tests on real built package: https://github.com/NixOS/nixpkgs/issues/255262
# tests/ are not included to output package, so we have to set path explicitly
preCheck = ''
appendToVar pytestFlagsArray "$src/tests"
appendToVar enabledTestPaths "$src/tests"
cd $out
'';
nativeCheckInputs = [ pytestCheckHook ];

View File

@ -63,16 +63,15 @@ buildPythonPackage rec {
snapshottest
];
pytestFlagsArray = [
"-m"
"'not remote_data'"
];
disabledTestPaths = lib.optionals (pythonAtLeast "3.12") [
# requires snapshottest
"duckdb_engine/tests/test_datatypes.py"
];
disabledTestMarks = [
"remote_data"
];
disabledTests = [
# user agent not available in nixpkgs
"test_user_agent"

View File

@ -26,7 +26,7 @@ buildPythonPackage rec {
# needs to be updated to newer pytest version and requires physical device
doCheck = false;
pytestFlags = [ "icontrol/test" ];
enabledTestPaths = [ "icontrol/test" ];
pythonImportsCheck = [ "icontrol" ];

View File

@ -40,7 +40,7 @@ buildPythonPackage rec {
];
# avoid tests which import random2, an abandoned library
pytestFlagsArray = [ "--ignore=tests/providers/test_ssn.py" ];
disabledTestPaths = [ "tests/providers/test_ssn.py" ];
pythonImportsCheck = [ "faker" ];
meta = with lib; {

View File

@ -55,7 +55,7 @@ buildPythonPackage rec {
pythonImportsCheck = [ "fakeredis" ];
pytestFlagsArray = [ "-m 'not slow'" ];
disabledTestMarks = [ "slow" ];
preCheck = ''
redisTestPort=6390

View File

@ -42,7 +42,7 @@ buildPythonPackage {
pytest-benchmark
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
# Python source files interfere with testing
preCheck = ''

View File

@ -38,9 +38,9 @@ buildPythonPackage rec {
"test_compile_to_code_custom_format" # cannot import temporary module created during test
];
pytestFlagsArray = [
disabledTestPaths = [
# fastjsonschema.exceptions.JsonSchemaDefinitionException: Unknown format uuid/duration
"--deselect=tests/json_schema/test_draft2019.py::test"
"tests/json_schema/test_draft2019.py::test"
];
pythonImportsCheck = [ "fastjsonschema" ];

View File

@ -75,10 +75,10 @@ buildPythonPackage rec {
rm -r fiona # prevent importing local fiona
'';
pytestFlagsArray = [
disabledTestMarks = [
# Tests with gdal marker do not test the functionality of Fiona,
# but they are used to check GDAL driver capabilities.
"-m 'not gdal'"
"gdal"
];
disabledTests = [

View File

@ -58,7 +58,7 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [
pytestFlags = [
"--skip-download"
];

View File

@ -61,8 +61,11 @@ buildPythonPackage {
python3 ./example.py db upgrade
'';
pytestFlagsArray = [
pytestFlags = [
"-x"
];
disabledTestPaths = [
"tests/func/"
"tests/unit"
];

View File

@ -60,15 +60,17 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray =
pytestFlags = [
"--benchmark-disable"
];
disabledTestPaths =
[
"--benchmark-disable"
"--deselect=tests/test_inputs.py::URLTest::test_check"
"--deselect=tests/test_inputs.py::EmailTest::test_valid_value_check"
"--deselect=tests/test_logging.py::LoggingTest::test_override_app_level"
"tests/test_inputs.py::URLTest::test_check"
"tests/test_inputs.py::EmailTest::test_valid_value_check"
"tests/test_logging.py::LoggingTest::test_override_app_level"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
"--deselect=tests/test_inputs.py::EmailTest::test_invalid_values_check"
"tests/test_inputs.py::EmailTest::test_invalid_values_check"
];
disabledTests = [

View File

@ -37,7 +37,7 @@ buildPythonPackage rec {
pythonImportsCheck = [ "flask_unsign" ];
pytestFlagsArray = [ "tests/flask_unsign.py" ];
enabledTestPaths = [ "tests/flask_unsign.py" ];
meta = {
description = "Command line tool to fetch, decode, brute-force and craft session cookies of Flask applications";

View File

@ -83,11 +83,10 @@ buildPythonPackage rec {
tensorflow
];
pytestFlagsArray = [
"-W"
pytestFlags = [
# DeprecationWarning: Triggering of __jax_array__() during abstractification is deprecated.
# To avoid this error, either explicitly convert your object using jax.numpy.array(), or register your object as a pytree.
"ignore::DeprecationWarning"
"-Wignore::DeprecationWarning"
];
disabledTestPaths = [

View File

@ -38,9 +38,9 @@ buildPythonPackage rec {
export HOME=$TMPDIR
'';
pytestFlagsArray = [
disabledTestMarks = [
# disable tests which require network access
"-m 'not request'"
"request"
];
pythonImportsCheck = [ "geodatasets" ];

View File

@ -45,7 +45,7 @@ buildPythonPackage rec {
"test_initialize_method_cache_valid_types"
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
pythonImportsCheck = [ "getmac" ];

View File

@ -48,7 +48,7 @@ buildPythonPackage rec {
__darwinAllowLocalNetworking = true;
pytestFlagsArray = [ "-m 'not network'" ];
disabledTestMarks = [ "network" ];
pythonImportsCheck = [ "geventhttpclient" ];

View File

@ -54,7 +54,7 @@ buildPythonPackage rec {
pytest-rerunfailures
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
meta = {
description = "Knock on the Python GIL, determine how busy it is";

View File

@ -81,6 +81,9 @@ buildPythonPackage rec {
"system_tests/"
# Requires a running aiohttp event loop
"tests_async/"
# cryptography 44 compat issue
"tests/transport/test__mtls_helper.py::TestDecryptPrivateKey::test_success"
];
pythonImportsCheck = [
@ -88,11 +91,6 @@ buildPythonPackage rec {
"google.oauth2"
];
pytestFlagsArray = [
# cryptography 44 compat issue
"--deselect=tests/transport/test__mtls_helper.py::TestDecryptPrivateKey::test_success"
];
__darwinAllowLocalNetworking = true;
meta = {

View File

@ -72,16 +72,15 @@ buildPythonPackage rec {
++ lib.optionals (!cudaSupport) [ "test/test_cuda.py" ];
# Require GPU access to run (not available in the sandbox)
pytestFlagsArray =
disabledTests =
lib.optionals (!testCudaRuntime) [
"-k"
"'not TestCUDADevice'"
"TestCUDADevice"
]
++ lib.optionals (!testRocmRuntime) [
"-k"
"'not TestHIPDevice'"
]
++ lib.optionals (testCudaRuntime || testOpenclRuntime || testRocmRuntime) [ "-v" ];
"TestHIPDevice"
];
pytestFlags = lib.optionals (testCudaRuntime || testOpenclRuntime || testRocmRuntime) [ "-v" ];
# Running these tests requires special configuration on the builder.
# e.g. https://github.com/NixOS/nixpkgs/pull/256230 implements a nix

View File

@ -82,9 +82,12 @@ buildPythonPackage rec {
export PATH=$out/bin:$PATH
'';
pytestFlagsArray = [
pytestFlags = [
"--asyncio-mode=auto"
"-m 'not online'"
];
disabledTestMarks = [
"online"
];
disabledTests = [

View File

@ -86,10 +86,16 @@ buildPythonPackage rec {
cat ${./conftest-skip-network-errors.py} >> test/conftest.py
'';
pytestFlagsArray = [
pytestFlags = [
#"-x" "-Wignore" # uncomment for debugging help
];
enabledTestPaths = [
"test/"
"-m 'not flaky'"
#"-x" "-W" "ignore" # uncomment for debugging help
];
disabledTestMarks = [
"flaky"
];
disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [

View File

@ -322,10 +322,13 @@ buildPythonPackage rec {
"test/test_docker/test_reverse_proxy_root_path/test_reverse_proxy_root_path.py"
];
pytestFlagsArray = [
disabledTestMarks = [
"flaky"
];
pytestFlags = [
"-x" # abort on first failure
"-m 'not flaky'"
#"-W" "ignore" # uncomment for debugging help
#"-Wignore" # uncomment for debugging help
];
# check the binary works outside the build env

View File

@ -39,7 +39,7 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
pythonImportsCheck = [ "graphql" ];

View File

@ -73,18 +73,23 @@ buildPythonPackage rec {
pytestCheckHook
testfixtures
];
pytestFlagsArray = [
enabledTestPaths = [
"tests"
"--ignore=docs"
"--ignore=tests/test_sklearn.py"
];
disabledTests = [ "gridplot_outputs" ];
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# SIGABRT
"tests/test_plot.py"
"tests/test_plot_matrix.py"
];
disabledTestPaths =
[
"docs"
"tests/test_sklearn.py"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# SIGABRT
"tests/test_plot.py"
"tests/test_plot_matrix.py"
];
meta = with lib; {
description = "Package for graph statistical algorithms";

View File

@ -121,6 +121,12 @@ buildPythonPackage rec {
"tests/render"
];
disabledTestMarks = [
"postgresql"
"snowflake"
"spark"
];
disabledTests = [
# tries to access network:
"test_checkpoint_run_with_data_docs_and_slack_actions_emit_page_links"
@ -128,7 +134,6 @@ buildPythonPackage rec {
];
pythonImportsCheck = [ "great_expectations" ];
pytestFlagsArray = [ "-m 'not spark and not postgresql and not snowflake'" ];
meta = {
broken = true; # 408 tests fail

View File

@ -16,6 +16,8 @@
}:
buildPythonPackage rec {
__structuredAttrs = true;
pname = "gremlinpython";
version = "3.7.3";
format = "setuptools";
@ -73,23 +75,20 @@ buildPythonPackage rec {
"tests/process/test_dsl.py"
"tests/structure/io/test_functionalityio.py"
];
pytestFlagsArray =
let
fullDisabled = builtins.concatStringsSep " or " [
"test_transaction_commit"
"test_transaction_rollback"
"test_transaction_no_begin"
"test_multi_commit_transaction"
"test_multi_rollback_transaction"
"test_multi_commit_and_rollback"
"test_transaction_close_tx"
"test_transaction_close_tx_from_parent"
];
in
[
# disabledTests doesn't quite allow us to be precise enough for this
"-k 'not ((TestFunctionalGraphSONIO and (test_timestamp or test_datetime or test_uuid)) or ${fullDisabled})'"
];
disabledTests = [
"TestFunctionalGraphSONIO and test_timestamp"
"TestFunctionalGraphSONIO and test_datetime"
"TestFunctionalGraphSONIO and test_uuid"
"test_transaction_commit"
"test_transaction_rollback"
"test_transaction_no_begin"
"test_multi_commit_transaction"
"test_multi_rollback_transaction"
"test_multi_commit_and_rollback"
"test_transaction_close_tx"
"test_transaction_close_tx_from_parent"
];
meta = with lib; {
description = "Gremlin-Python implements Gremlin, the graph traversal language of Apache TinkerPop, within the Python language";

View File

@ -58,9 +58,8 @@ buildPythonPackage rec {
flaky
];
pytestFlagsArray = [
"-W"
"ignore::FutureWarning"
pytestFlags = [
"-Wignore::FutureWarning"
];
disabledTests = [

View File

@ -38,7 +38,7 @@ buildPythonPackage rec {
# There are currently no checks which do not require network access, which breaks the check hook somehow?
# nativeCheckInputs = [ pytestCheckHook ];
# pytestFlagsArray = [ "-m 'not network'" ];
# disabledTestMarks = [ "network" ];
nativeBuildInputs = [ versionCheckHook ];

View File

@ -63,7 +63,7 @@ buildPythonPackage rec {
"test_connection_close"
];
pytestFlagsArray = [ "--ignore python2" ];
disabledTestPaths = [ "python2" ];
pythonImportsCheck = [ "httplib2" ];

View File

@ -143,12 +143,12 @@ buildPythonPackage rec {
writableTmpDirAsHomeHook
] ++ lib.concatMap (name: optional-dependencies.${name}) testBackends;
pytestFlagsArray = [
pytestFlags = [
"--benchmark-disable"
"-m"
"'${lib.concatStringsSep " or " testBackends} or core'"
];
enabledTestMarks = testBackends ++ [ "core" ];
disabledTests = [
# tries to download duckdb extensions
"test_attach_sqlite"

View File

@ -46,7 +46,7 @@ buildPythonPackage rec {
syrupy
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
pythonImportsCheck = [ "ical" ];

View File

@ -46,20 +46,23 @@ buildPythonPackage rec {
# runs successfully in 3.9, however, async isn't correctly closed so it will fail after test suite.
doCheck = pythonOlder "3.9";
enabledTestPaths = [
"tests/"
];
# Some packages are not in NixPkgs; other tests try to build distributed
# models, which doesn't work in the sandbox.
# avoid tests which need special packages
pytestFlagsArray = [
"--ignore=tests/ignite/contrib/handlers/test_clearml_logger.py"
"--ignore=tests/ignite/contrib/handlers/test_lr_finder.py"
"--ignore=tests/ignite/contrib/handlers/test_trains_logger.py"
"--ignore=tests/ignite/metrics/nlp/test_bleu.py"
"--ignore=tests/ignite/metrics/nlp/test_rouge.py"
"--ignore=tests/ignite/metrics/gan" # requires pytorch_fid; tries to download model to $HOME
"--ignore=tests/ignite/metrics/test_dill.py"
"--ignore=tests/ignite/metrics/test_psnr.py"
"--ignore=tests/ignite/metrics/test_ssim.py"
"tests/"
disabledTestPaths = [
"tests/ignite/contrib/handlers/test_clearml_logger.py"
"tests/ignite/contrib/handlers/test_lr_finder.py"
"tests/ignite/contrib/handlers/test_trains_logger.py"
"tests/ignite/metrics/nlp/test_bleu.py"
"tests/ignite/metrics/nlp/test_rouge.py"
"tests/ignite/metrics/gan" # requires pytorch_fid; tries to download model to $HOME
"tests/ignite/metrics/test_dill.py"
"tests/ignite/metrics/test_psnr.py"
"tests/ignite/metrics/test_ssim.py"
];
# disable tests which need specific packages

View File

@ -84,7 +84,7 @@ buildPythonPackage rec {
++ fsspec.optional-dependencies.github
++ lib.flatten (builtins.attrValues optional-dependencies);
pytestFlagsArray = [ "-m 'not needs_internet'" ];
disabledTestMarks = [ "needs_internet" ];
preCheck = ''
export IMAGEIO_USERDIR=$(mktemp -d)

View File

@ -49,10 +49,10 @@ buildPythonPackage rec {
export PATH=$PATH:$out/bin
'';
pytestFlagsArray = [
"--ignore=tests/benchmark/" # requires pytest-benchmark
"--ignore=tests/integration/" # pulls in 10 other packages
"--ignore=tests/unit/profiles/test_black.py" # causes infinite recursion to include black
disabledTestPaths = [
"tests/benchmark/" # requires pytest-benchmark
"tests/integration/" # pulls in 10 other packages
"tests/unit/profiles/test_black.py" # causes infinite recursion to include black
];
disabledTests = [

View File

@ -83,23 +83,26 @@ buildPythonPackage rec {
# high parallelism will result in the tests getting stuck
dontUsePytestXdist = true;
pytestFlags = [
"--numprocesses=4"
"-Wignore::DeprecationWarning"
];
# NOTE: Don't run the tests in the experimental directory as they require flax
# which creates a circular dependency. See https://discourse.nixos.org/t/how-to-nix-ify-python-packages-with-circular-dependencies/14648/2.
# Not a big deal, this is how the JAX docs suggest running the test suite
# anyhow.
pytestFlagsArray =
[
"--numprocesses=4"
"-W ignore::DeprecationWarning"
"tests/"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# SystemError: nanobind::detail::nb_func_error_except(): exception could not be translated!
# reported at: https://github.com/jax-ml/jax/issues/26106
"--deselect tests/pjit_test.py::PJitErrorTest::testAxisResourcesMismatch"
"--deselect tests/shape_poly_test.py::ShapePolyTest"
"--deselect tests/tree_util_test.py::TreeTest"
];
enabledTestPaths = [
"tests/"
];
disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
# SystemError: nanobind::detail::nb_func_error_except(): exception could not be translated!
# reported at: https://github.com/jax-ml/jax/issues/26106
"tests/pjit_test.py::PJitErrorTest::testAxisResourcesMismatch"
"tests/shape_poly_test.py::ShapePolyTest"
"tests/tree_util_test.py::TreeTest"
];
# Prevents `tests/export_back_compat_test.py::CompatTest::test_*` tests from failing on darwin with
# PermissionError: [Errno 13] Permission denied: '/tmp/back_compat_testdata/test_*.py'

View File

@ -38,8 +38,11 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [
pytestFlags = [
"--asyncio-mode=auto"
];
enabledTestPaths = [
"tests.py"
];

View File

@ -22,7 +22,13 @@ buildPythonPackage rec {
propagatedBuildInputs = [ six ];
nativeCheckInputs = [ pytestCheckHook ];
pytestFlagsArray = [ "tests --doctest-modules jsonstreams" ];
pytestFlags = [ "--doctest-modules" ];
enabledTestPaths = [
"tests"
"jsonstreams"
];
meta = with lib; {
broken = stdenv.hostPlatform.isDarwin;

View File

@ -55,13 +55,15 @@ buildPythonPackage rec {
writableTmpDirAsHomeHook
];
pytestFlagsArray = [
pytestFlags = [
# pytest.PytestCacheWarning: could not create cache path /build/source/.pytest_cache/v/cache/nodeids: [Errno 13] Permission denied: '/build/source/pytest-cache-files-plraagdr'
"-p"
"no:cacheprovider"
"$src/tests"
"-pno:cacheprovider"
];
preCheck = ''
appendToVar enabledTestPaths "$src/tests"
'';
__darwinAllowLocalNetworking = true;
meta = {

View File

@ -53,7 +53,7 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [ "-m 'not network'" ];
disabledTestMarks = [ "network" ];
pythonImportsCheck = [ "kanidm" ];

View File

@ -132,32 +132,30 @@ buildPythonPackage rec {
pythonImportsCheck = [ "kserve" ];
pytestFlagsArray =
disabledTestPaths =
[
# Looks for a config file at the root of the repository
"test/test_inference_service_client.py"
# AssertionError
"--deselect=test/test_server.py::TestTFHttpServerLoadAndUnLoad::test_unload"
"test/test_server.py::TestTFHttpServerLoadAndUnLoad::test_unload"
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
# RuntimeError: Failed to start GCS
"--deselect=test/test_dataplane.py::TestDataPlane::test_explain"
"--deselect=test/test_dataplane.py::TestDataPlane::test_infer"
"--deselect=test/test_dataplane.py::TestDataPlane::test_model_metadata"
"--deselect=test/test_dataplane.py::TestDataPlane::test_server_readiness"
"--deselect=test/test_server.py::TestRayServer::test_explain"
"--deselect=test/test_server.py::TestRayServer::test_health_handler"
"--deselect=test/test_server.py::TestRayServer::test_infer"
"--deselect=test/test_server.py::TestRayServer::test_list_handler"
"--deselect=test/test_server.py::TestRayServer::test_liveness_handler"
"--deselect=test/test_server.py::TestRayServer::test_predict"
"test/test_dataplane.py::TestDataPlane::test_explain"
"test/test_dataplane.py::TestDataPlane::test_infer"
"test/test_dataplane.py::TestDataPlane::test_model_metadata"
"test/test_dataplane.py::TestDataPlane::test_server_readiness"
"test/test_server.py::TestRayServer::test_explain"
"test/test_server.py::TestRayServer::test_health_handler"
"test/test_server.py::TestRayServer::test_infer"
"test/test_server.py::TestRayServer::test_list_handler"
"test/test_server.py::TestRayServer::test_liveness_handler"
"test/test_server.py::TestRayServer::test_predict"
# Permission Error
"--deselect=test/test_server.py::TestMutiProcessServer::test_rest_server_multiprocess"
"test/test_server.py::TestMutiProcessServer::test_rest_server_multiprocess"
];
disabledTestPaths = [
# Looks for a config file at the root of the repository
"test/test_inference_service_client.py"
];
disabledTests =
[
# Require network access

View File

@ -95,7 +95,7 @@ buildPythonPackage rec {
"test_timing"
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
meta = with lib; {
description = "Embedded control & testing library";

View File

@ -92,7 +92,7 @@ buildPythonPackage rec {
cd python/python/tests
'';
pytestFlagsArray = [ "-m 'not slow'" ];
disabledTestMarks = [ "slow" ];
disabledTests = [
# require tantivy which is not packaged in nixpkgs

View File

@ -56,7 +56,7 @@ buildPythonPackage rec {
syrupy
];
pytestFlagsArray = [ "tests/unit_tests" ];
enabledTestPaths = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_deepseek" ];

View File

@ -58,7 +58,7 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [ "tests/unit_tests" ];
enabledTestPaths = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_fireworks" ];

View File

@ -58,7 +58,7 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [ "tests/unit_tests" ];
enabledTestPaths = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_mistralai" ];

View File

@ -56,7 +56,7 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [ "tests/unit_tests" ];
enabledTestPaths = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_perplexity" ];

View File

@ -58,7 +58,7 @@ buildPythonPackage rec {
pytestCheckHook
];
pytestFlagsArray = [ "tests/unit_tests" ];
enabledTestPaths = [ "tests/unit_tests" ];
pythonImportsCheck = [ "langchain_xai" ];

View File

@ -101,10 +101,13 @@ buildPythonPackage rec {
toml
];
pytestFlagsArray = [
pytestFlags = [
"--only-core"
];
enabledTestPaths = [
# integration_tests require network access, database access and require `OPENAI_API_KEY`, etc.
"tests/unit_tests"
"--only-core"
];
disabledTests = [

View File

@ -62,9 +62,11 @@ buildPythonPackage rec {
nativeCheckInputs = [ pytestCheckHook ];
pytestFlags = [
enabledTestPaths = [
"tests/test_cli.py"
"-k"
];
enabledTests = [
"test_cli_format"
];

View File

@ -43,7 +43,7 @@ buildPythonPackage rec {
nativeCheckInputs = [ unittestCheckHook ];
pytestFlagsArray = [ "test/" ];
enabledTestPaths = [ "test/" ];
preCheck = ''
export SERVER=NONE

View File

@ -49,7 +49,7 @@ buildPythonPackage rec {
pytest-xdist
];
pytestFlagsArray = [ "--benchmark-disable" ];
pytestFlags = [ "--benchmark-disable" ];
disabledTests = [
# touches network

Some files were not shown because too many files have changed in this diff Show More