python.pkgs.zodb: remove obsolete patches and fix tests

This commit is contained in:
Robert Schütz 2018-12-03 12:16:13 +01:00 committed by Frederik Rietdijk
parent 73eb15fe6a
commit 79ced8c6da
3 changed files with 9 additions and 62 deletions

View File

@ -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),
])

View File

@ -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;

View File

@ -1,26 +0,0 @@
From 2d0ae7199501795617a82a32bafe19b4b5ae89c3 Mon Sep 17 00:00:00 2001
From: Jason Madden <jamadden@gmail.com>
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"),