Commit e31dea3d authored by Ivan Kozik's avatar Ivan Kozik
Browse files

python3Packages.parsimonious: disable benchmark tests that may fail

This fixes

```
=================================== FAILURES ===================================
______________________ TestBenchmarks.test_lists_vs_dicts ______________________

self = <parsimonious.tests.test_benchmarks.TestBenchmarks testMethod=test_lists_vs_dicts>

    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 ====================
```
parent 768a982b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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"