From b7d7652c664198c68ef2a4f2e643858da77c9b56 Mon Sep 17 00:00:00 2001 From: Brandon Rhodes Date: Mon, 16 Dec 2019 11:43:52 -0500 Subject: [PATCH] Protect doctests against old numpy versions --- jplephem/test.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/jplephem/test.py b/jplephem/test.py index 14f2467..8795577 100644 --- a/jplephem/test.py +++ b/jplephem/test.py @@ -431,6 +431,13 @@ File type NAIF/DAF and format BIG-IEEE with 15 segments: def load_tests(loader, tests, ignore): """Run our main documentation as a test.""" + # If we are running in CI, where we test against an old version of + # NumPy, skip the doctests since NumPy will print whitespace + # differently (and worse). + version = tuple(int(s) for s in np.__version__.split('.')) + if version < (1, 17): + return + # Python 2.6 formats floating-point numbers a bit differently and # breaks the doctest. if sys.version_info >= (2, 7):