From 79ced8c6da745133e0bed858565e34158fb788e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20Sch=C3=BCtz?= Date: Mon, 3 Dec 2018 12:16:13 +0100 Subject: [PATCH] python.pkgs.zodb: remove obsolete patches and fix tests --- .../zodb/ZODB-5.3.0-fix-tests.patch | 29 ------------------- .../python-modules/zodb/default.nix | 16 +++++----- .../zodb/fix-tests-with-persistent-4.4.patch | 26 ----------------- 3 files changed, 9 insertions(+), 62 deletions(-) delete mode 100644 pkgs/development/python-modules/zodb/ZODB-5.3.0-fix-tests.patch delete mode 100644 pkgs/development/python-modules/zodb/fix-tests-with-persistent-4.4.patch diff --git a/pkgs/development/python-modules/zodb/ZODB-5.3.0-fix-tests.patch b/pkgs/development/python-modules/zodb/ZODB-5.3.0-fix-tests.patch deleted file mode 100644 index b6bcedea91a8..000000000000 --- a/pkgs/development/python-modules/zodb/ZODB-5.3.0-fix-tests.patch +++ /dev/null @@ -1,29 +0,0 @@ -Tests are kind of broken in ZODB-5.3.0. Fix setup code and disable one -especially problematic test. - -diff -u ZODB-5.3.0/setup.py ZODB-5.3.0/setup.py ---- ZODB-5.3.0/setup.py 2017-08-30 14:55:10.000000000 +0200 -+++ ZODB-5.3.0/setup.py 2017-10-29 11:34:17.277953730 +0100 -@@ -85,7 +85,10 @@ - mod = __import__( - _modname(dirpath, base, os.path.splitext(filename)[0]), - {}, {}, ['*']) -- _unittests_only(suite, mod.test_suite()) -+ try: -+ _unittests_only(suite, mod.test_suite()) -+ except AttributeError: -+ pass - elif 'tests.py' in filenames: - mod = __import__(_modname(dirpath, base, 'tests'), {}, {}, ['*']) - _unittests_only(suite, mod.test_suite()) -diff -u ZODB-5.3.0/src/ZODB/scripts/tests/test_repozo.py ZODB-5.3.0/src/ZODB/scripts/tests/test_repozo.py ---- ZODB-5.3.0/src/ZODB/scripts/tests/test_repozo.py 2017-08-30 14:55:10.000000000 +0200 -+++ ZODB-5.3.0/src/ZODB/scripts/tests/test_repozo.py 2017-10-29 11:35:10.348240386 +0100 -@@ -1184,7 +1184,4 @@ - #unittest.makeSuite(Test_do_backup), #TODO - unittest.makeSuite(Test_do_recover), - unittest.makeSuite(Test_do_verify), -- # N.B.: this test take forever to run (~40sec on a fast laptop), -- # *and* it is non-deterministic. -- unittest.makeSuite(MonteCarloTests), - ]) diff --git a/pkgs/development/python-modules/zodb/default.nix b/pkgs/development/python-modules/zodb/default.nix index 3ec954f1235b..c79352085368 100644 --- a/pkgs/development/python-modules/zodb/default.nix +++ b/pkgs/development/python-modules/zodb/default.nix @@ -1,6 +1,7 @@ { stdenv , fetchPypi , buildPythonPackage +, python , zope_testrunner , transaction , six @@ -22,13 +23,10 @@ buildPythonPackage rec { sha256 = "20155942fa326e89ad8544225bafd74237af332ce9d7c7105a22318fe8269666"; }; - patches = [ - ./ZODB-5.3.0-fix-tests.patch # still needeed with 5.4.0 - # Upstream patch to fix tests with persistent 4.4, - # cannot fetchpatch because only one hunk of the upstream commit applies. - # TODO remove on next release - ./fix-tests-with-persistent-4.4.patch - ]; + # remove broken test + postPatch = '' + rm -vf src/ZODB/tests/testdocumentation.py + ''; propagatedBuildInputs = [ transaction @@ -46,6 +44,10 @@ buildPythonPackage rec { zope_testrunner ]; + checkPhase = '' + ${python.interpreter} -m zope.testrunner --test-path=src [] + ''; + meta = with stdenv.lib; { description = "Zope Object Database: object database and persistence"; homepage = https://pypi.python.org/pypi/ZODB; diff --git a/pkgs/development/python-modules/zodb/fix-tests-with-persistent-4.4.patch b/pkgs/development/python-modules/zodb/fix-tests-with-persistent-4.4.patch deleted file mode 100644 index 57946dd29863..000000000000 --- a/pkgs/development/python-modules/zodb/fix-tests-with-persistent-4.4.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 2d0ae7199501795617a82a32bafe19b4b5ae89c3 Mon Sep 17 00:00:00 2001 -From: Jason Madden -Date: Wed, 22 Aug 2018 10:43:19 -0500 -Subject: [PATCH] Fix tests with, and depend on, persistent 4.4. - -Fixes #213. ---- - src/ZODB/tests/util.py | 5 +++++ - 3 files changed, 9 insertions(+), 3 deletions(-) - -diff --git a/src/ZODB/tests/util.py b/src/ZODB/tests/util.py -index 4ffde92c1..e9bf547fa 100644 ---- a/src/ZODB/tests/util.py -+++ b/src/ZODB/tests/util.py -@@ -37,6 +37,11 @@ - r"\1"), - (re.compile('b(".*?")'), - r"\1"), -+ # Persistent 4.4 changes the repr of persistent subclasses, -+ # and it is slightly different with the C extension and -+ # pure-Python module -+ (re.compile('ZODB.tests.testcrossdatabasereferences.'), -+ ''), - # Python 3 adds module name to exceptions. - (re.compile("ZODB.interfaces.BlobError"), - r"BlobError"),