From 8dfdc2b3677d5000b80fbd879875699699a874eb Mon Sep 17 00:00:00 2001 From: Thomas Robitaille Date: Thu, 5 Dec 2019 14:26:29 +0000 Subject: [PATCH] Catch case where the astropy version is 'unknown', which most likely means that we are running pytest directly from the astropy source directory --- pytest_astropy_header/display.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pytest_astropy_header/display.py b/pytest_astropy_header/display.py index 895f228..48c8a22 100644 --- a/pytest_astropy_header/display.py +++ b/pytest_astropy_header/display.py @@ -34,8 +34,11 @@ TESTED_VERSIONS = OrderedDict([('Astropy', astropy_version)]) - ASTROPY_LT_30 = LooseVersion(astropy_version) < '3.0' - ASTROPY_LT_40 = LooseVersion(astropy_version) < '4.0' + if astropy_version == 'unknown': # assume developer version + ASTROPY_LT_30 = ASTROPY_LT_40 = False + else: + ASTROPY_LT_30 = LooseVersion(astropy_version) < '3.0' + ASTROPY_LT_40 = LooseVersion(astropy_version) < '4.0' # If using a version of astropy that has the display plugin, we make sure that # we use those variables for listing the packages, in case we choose to let