Package: python-cogent / 1.9-14

numpy-doctests.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
Description: Ensure doctests pass with different numpy versions
 The numpy output format changed with numpy 1.14 and this causes doctests to
 fail if raw numerical output is compared. See
 https://wiki.debian.org/ContinuousIntegration/TriagingTips/numpy-1.14-doctests
Author: Stuart Prescott <stuart@debian.org>
Last-Update: Tue, 05 Jun 2018 15:32:46 +0000 (UTC)
Origin: https://github.com/pycogent/pycogent/files/2072985/numpy-doctests.patch
Bug-Debian: https://bugs.debian.org/899205

--- a/tests/alltests.py
+++ b/tests/alltests.py
@@ -6,6 +6,14 @@
 import doctest, cogent.util.unit_test as unittest, sys, os
 from cogent.util.misc import app_path
 
+# Whitespace changes between numpy 1.13 and 1.14 will cause the doctests
+# to fail; when doctests are updated to 1.14 format, this can be removed.
+try:    # CRUFT
+    import numpy as np
+    np.set_printoptions(legacy='1.13')
+except TypeError:
+    pass
+
 __author__ = "Peter Maxwell and Gavin Huttley"
 __copyright__ = "Copyright 2007-2016, The Cogent Project"
 __credits__ = ["Peter Maxwell", "Gavin Huttley", "Rob Knight",