Skip to content

Commit

Permalink
add skip doctest
Browse files Browse the repository at this point in the history
  • Loading branch information
somilia committed Nov 17, 2023
1 parent 2525271 commit a0d07d1
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
12 changes: 4 additions & 8 deletions docs/mivot/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,13 @@ The API allows you to obtain a model view on the last read data row, this usage
>>> from pyvo.utils.prototype import activate_features
>>> activate_features('MIVOT')
>>> votable = get_pkg_data_filename("data/simple-annotation-votable.xml", package="pyvo.mivot.tests")
>>> if check_astropy_version():
>>> if check_astropy_version(): # doctest: +SKIP
... m_viewer = ModelViewer(votable)
... row_view = m_viewer.get_next_row_view()
... print(row_view.longitude.value)
... print(row_view.Coordinate_coosys.PhysicalCoordSys_frame.spaceRefFrame.value)
10.0
ICRS
... else:
Astropy version 5.3.4 is below the required version 6.0 for the use of MIVOT.
10.0
ICRS


The model view is a dynamically generated Python object whose field names are derived from
Expand All @@ -55,16 +53,14 @@ Example for epoch propagation
-----------------------------
.. doctest-remote-data::
>>> if check_astropy_version():
... with ModelViewer(votable) as m_viewer:
... with ModelViewer(votable) as m_viewer: # doctest: +SKIP
... row_view = m_viewer.get_next_row_view()
... past_ra, past_dec = row_view.apply_space_motion(dt=-42 * u.year)
... future_ra, future_dec = row_view.apply_space_motion(dt=2 * u.year)
... print("past_ra, past_dec :", row_view.apply_space_motion(dt=-42 * u.year))
... print("future_ra, future_dec :", row_view.apply_space_motion(dt=2 * u.year))
past_ra, past_dec : (<Longitude 9.9998763 deg>, <Latitude 10.00024364 deg>)
future_ra, future_dec : (<Longitude 10.00000563 deg>, <Latitude 9.99998891 deg>)
... else:
Astropy version 5.3.4 is below the required version 6.0 for the use of MIVOT.

Implementation
==============
Expand Down
4 changes: 2 additions & 2 deletions pyvo/mivot/tests/test_model_viewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def test_check_version(data_path):
match=f"Astropy version {astropy_version.version} "
f"is below the required version 6.0 for the use of MIVOT."):
ModelViewer(votable_path=votable)


@pytest.fixture
def m_viewer(data_path):
if check_astropy_version() is False:
Expand Down
3 changes: 0 additions & 3 deletions pyvo/mivot/tests/test_model_viewer_layer1.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@
from pyvo.mivot.version_checker import check_astropy_version
from pyvo.mivot.viewer.model_viewer import ModelViewer
from pyvo.utils.prototype import activate_features
from pyvo.mivot.utils.exceptions import AstropyVersionException
from astropy import version as astropy_version
activate_features('MIVOT')



def test_model_viewer_layer1(m_viewer):
if check_astropy_version() is False:
pytest.skip("MIVOT test skipped because of the astropy version.")
Expand Down
1 change: 0 additions & 1 deletion pyvo/mivot/version_checker.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from pyvo.mivot.utils.exceptions import AstropyVersionException
from astropy import version as astropy_version


Expand Down

0 comments on commit a0d07d1

Please sign in to comment.