python/natsort: Skip some tests with Python 3.[56]

Since the update to Python 3.6.3 in f906d6d18e
some of the Hypothesis tests in natsort suddenly begin to fail with
errors like this one:

res = '\x00\x00', f = <built-in function strxfrm>

>   return partial(reduce, lambda res, f: f(res), functions)
E   ValueError: embedded null character

The tests didn't fail with Python 3.6.2, but they did fail with Python
3.5 already.

I didn't dig through what the exact problem was, but I'd guess that the
problem could lie in Hypothesis itself. Unfortunately updating to the
latest version of Hypothesis didn't turn out to be that easy as well,
because the newer versions have a circular dependency on pytest and a
few other libraries.

So I opted against updating Hypothesis for now and just mark the tests
as "expected to fail" on purpose so that whenever we someday have a
newer version of Hypothesis, the build for natsort will fail and we can
remove this patch again.

Tested against Python 2.7, 3.4, 3.5 and 3.6 and all of the builds now
succeed.

Signed-off-by: aszlig <aszlig@nix.build>
Cc: @jluttine, @FRidh
This commit is contained in:
aszlig
2017-11-09 06:42:01 +01:00
parent 63a47699f7
commit e13c6645b1
2 changed files with 41 additions and 1 deletions

View File

@@ -1,6 +1,8 @@
{ lib
, buildPythonPackage
, pythonOlder
, isPy35
, isPy36
, fetchPypi
, hypothesis
, pytestcache
@@ -38,7 +40,8 @@ buildPythonPackage rec {
};
# do not run checks on nix_run_setup.py
patches = [ ./setup.patch ];
patches = lib.singleton ./setup.patch
++ lib.optional (isPy35 || isPy36) ./python-3.6.3-test-failures.patch;
# testing based on project's tox.ini
checkPhase = ''