From f29ec1b3a1d37e7f0efdd4bdcfc2b181ae0b1f9e Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Fri, 2 May 2025 11:54:29 +0800 Subject: [PATCH 1/3] python3Packages.essentials: disable broken tests on darwin --- pkgs/development/python-modules/essentials/default.nix | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pkgs/development/python-modules/essentials/default.nix b/pkgs/development/python-modules/essentials/default.nix index e94a3ccf98b8..f0174bb0a081 100644 --- a/pkgs/development/python-modules/essentials/default.nix +++ b/pkgs/development/python-modules/essentials/default.nix @@ -3,6 +3,7 @@ fetchFromGitHub, setuptools, pytestCheckHook, + stdenv, lib, }: buildPythonPackage rec { @@ -21,6 +22,12 @@ buildPythonPackage rec { nativeCheckInputs = [ pytestCheckHook ]; + disabledTests = lib.optionals stdenv.hostPlatform.isDarwin [ + # time.sleep(0.01) can be up to 0.05s on darwin + "test_stopwatch" + "test_stopwatch_with_context_manager" + ]; + pythonImportsCheck = [ "essentials" ]; meta = with lib; { From b20d91a4898e7b5ab38fe546a88b098dbc0ec735 Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Sat, 3 May 2025 10:36:51 +0800 Subject: [PATCH 2/3] pytyhon3Packages.essentials-openapi: fix tests on sandboxed darwin --- .../python-modules/essentials-openapi/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/python-modules/essentials-openapi/default.nix b/pkgs/development/python-modules/essentials-openapi/default.nix index cc31f97a17bb..450aedcca5b2 100644 --- a/pkgs/development/python-modules/essentials-openapi/default.nix +++ b/pkgs/development/python-modules/essentials-openapi/default.nix @@ -14,6 +14,7 @@ pyyaml, rich, setuptools, + stdenv, }: buildPythonPackage rec { pname = "essentials-openapi"; @@ -59,6 +60,13 @@ buildPythonPackage rec { pythonImportsCheck = [ "openapidocs" ]; + disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ + # These tests start a server using a hardcoded port, and since + # multiple Python versions are always built simultaneously, this + # failure is quite likely to occur. + "tests/test_cli.py" + ]; + meta = { homepage = "https://github.com/Neoteroi/essentials-openapi"; description = "Functions to handle OpenAPI Documentation"; From b302633dbabdadc8dcf012cb2b21682ec8c28641 Mon Sep 17 00:00:00 2001 From: Zexin Yuan Date: Sat, 3 May 2025 10:40:33 +0800 Subject: [PATCH 3/3] python3Packages.neoteroi-mkdocs: fix tests on sandboxed darwin --- .../python-modules/neoteroi-mkdocs/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/python-modules/neoteroi-mkdocs/default.nix b/pkgs/development/python-modules/neoteroi-mkdocs/default.nix index ad9f8ef42bd9..cc7fd7dc4542 100644 --- a/pkgs/development/python-modules/neoteroi-mkdocs/default.nix +++ b/pkgs/development/python-modules/neoteroi-mkdocs/default.nix @@ -12,6 +12,7 @@ pytestCheckHook, rich, setuptools, + stdenv, }: buildPythonPackage rec { pname = "neoteroi-mkdocs"; @@ -48,6 +49,13 @@ buildPythonPackage rec { pythonImportsCheck = [ "neoteroi.mkdocs" ]; + disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [ + # These tests start a server using a hardcoded port, and since + # multiple Python versions are always built simultaneously, this + # failure is quite likely to occur. + "tests/test_http.py" + ]; + meta = with lib; { homepage = "https://github.com/Neoteroi/mkdocs-plugins"; description = "Plugins for MkDocs";