From e31dea3d14e72a445db2c9b22f4ea005c36a5c85 Mon Sep 17 00:00:00 2001 From: Ivan Kozik Date: Tue, 17 Jan 2023 04:17:17 +0000 Subject: [PATCH] python3Packages.parsimonious: disable benchmark tests that may fail This fixes ``` =================================== FAILURES =================================== ______________________ TestBenchmarks.test_lists_vs_dicts ______________________ self = def test_lists_vs_dicts(self): """See what's faster at int key lookup: dicts or lists.""" list_time = timeit('item = l[9000]', 'l = [0] * 10000') dict_time = timeit('item = d[9000]', 'd = {x: 0 for x in range(10000)}') # Dicts take about 1.6x as long as lists in Python 2.6 and 2.7. > self.assertTrue(list_time < dict_time, '%s < %s' % (list_time, dict_time)) E AssertionError: False is not true : 0.051286615896970034 < 0.0440241270698607 parsimonious/tests/test_benchmarks.py:16: AssertionError =========================== short test summary info ============================ FAILED parsimonious/tests/test_benchmarks.py::TestBenchmarks::test_lists_vs_dicts =================== 1 failed, 82 passed, 2 skipped in 1.19s ==================== ``` --- pkgs/development/python-modules/parsimonious/default.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/development/python-modules/parsimonious/default.nix b/pkgs/development/python-modules/parsimonious/default.nix index f22b1b605e34..c6e25161e37e 100644 --- a/pkgs/development/python-modules/parsimonious/default.nix +++ b/pkgs/development/python-modules/parsimonious/default.nix @@ -26,6 +26,14 @@ buildPythonPackage rec { pytestCheckHook ]; + disabledTests = [ + # test_benchmarks.py tests are actually benchmarks and may fail due to + # something being unexpectedly slow on a heavily loaded build machine + "test_lists_vs_dicts" + "test_call_vs_inline" + "test_startswith_vs_regex" + ]; + postPatch = '' substituteInPlace setup.py \ --replace "regex>=2022.3.15" "regex"