Skip to content

Commit

Permalink
Implemented pytest.skip for Tools.Layouts on older OpticStudio versions
Browse files Browse the repository at this point in the history
  • Loading branch information
LucVV committed Feb 7, 2025
1 parent cd3c92b commit deea989
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/analyses/new/parsers/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from pandas.testing import assert_frame_equal
from pydantic import TypeAdapter, ValidationError

from tests.conftest import optic_studio_version
from zospy.analyses.new.parsers.types import ValidatedDataFrame, ValidatedNDArray, ZOSAPIConstantAnnotation
from zospy.api import constants

Expand Down Expand Up @@ -98,5 +99,7 @@ def _hasattr(obj, attr):
return True

@pytest.mark.parametrize("annotation", _get_instances())
def test_constant_exists(self, zos, annotation): # noqa: ARG002
def test_constant_exists(self, zos, annotation, optic_studio_version): # noqa: ARG002
if annotation.enum.startswith("Tools.Layouts") and optic_studio_version < "24.1.0":
pytest.skip(f"{annotation.enum} is only available from OpticStudio 24.1 onwards")
assert self._hasattr(constants, annotation.enum)

0 comments on commit deea989

Please sign in to comment.