Skip to content

Commit

Permalink
jdaviz version condition in test coverage
Browse files Browse the repository at this point in the history
  • Loading branch information
kecnry committed Jan 10, 2024
1 parent 9d79dc9 commit 6a0086e
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions lcviz/tests/test_plugin_ephemeris.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
import pytest
from packaging.version import Version

import jdaviz
JDAVIZ_LT_3_9_0 = Version(jdaviz.__version__) < Version('3.9.0')


def test_docs_snippets(helper, light_curve_like_kepler_quarter):
Expand Down Expand Up @@ -45,12 +49,13 @@ def test_plugin_ephemeris(helper, light_curve_like_kepler_quarter):
assert len(ephem.ephemerides) == 2
assert 'custom component' in ephem.ephemerides

with pytest.raises(ValueError):
# brackets interfere with cloned viewer label logic
ephem.rename_component('custom component', 'custom component[blah]')
with pytest.raises(ValueError):
# colons interfere with viewer ephemeris logic
ephem.rename_component('custom component', 'custom component:blah')
if not JDAVIZ_LT_3_9_0:
with pytest.raises(ValueError):
# brackets interfere with cloned viewer label logic
ephem.rename_component('custom component', 'custom component[blah]')
with pytest.raises(ValueError):
# colons interfere with viewer ephemeris logic
ephem.rename_component('custom component', 'custom component:blah')

ephem.rename_component('custom component', 'renamed custom component')
assert len(ephem.ephemerides) == 2
Expand Down

0 comments on commit 6a0086e

Please sign in to comment.