diff --git a/pytest.ini b/pytest.ini index 087be3d897..513158f531 100644 --- a/pytest.ini +++ b/pytest.ini @@ -14,6 +14,7 @@ markers = scalapack: Test requires ScaLAPACK (Intel MKL and OpenMPI). (select with '-m scalapack') datainstrument: Test uses data instrumentation (select with '-m datainstrument') hptt: Test requires the HPTT library (select with '-m "hptt') + py312: Test requires Python 3.12 or later (select with '-m "py312"') python_files = *_test.py *_cudatest.py diff --git a/tests/python_frontend/type_statement_test.py b/tests/python_frontend/type_statement_test.py index bf53ca5150..2009529f3a 100644 --- a/tests/python_frontend/type_statement_test.py +++ b/tests/python_frontend/type_statement_test.py @@ -1,25 +1,19 @@ # Copyright 2019-2023 ETH Zurich and the DaCe authors. All rights reserved. import dace import pytest -import sys +@pytest.mark.py312 def test_type_statement(): - if sys.version_info >= (3, 12): - - @dace.program - def type_statement(): - type Scalar[T] = T - A: Scalar[dace.float32] = 0 - return A - - with pytest.raises(dace.frontend.python.common.DaceSyntaxError): - type_statement() + @dace.program + def type_statement(): + type Scalar[T] = T + A: Scalar[dace.float32] = 0 + return A - else: - - assert True + with pytest.raises(dace.frontend.python.common.DaceSyntaxError): + type_statement() if __name__ == '__main__':