File tree Expand file tree Collapse file tree
src/psyclone/tests/psyir/transformations Expand file tree Collapse file tree Original file line number Diff line number Diff line change 4040API-agnostic tests for various transformation classes.
4141'''
4242
43+ import sys
4344import os
4445import pytest
4546from fparser .common .readfortran import FortranStringReader
@@ -590,13 +591,16 @@ def test_omploop_trans_new_options(sample_psyir):
590591
591592 with pytest .raises (TypeError ) as excinfo :
592593 omplooptrans .apply (tree .walk (Loop )[0 ], collapse = "x" )
593- # The exact error message depends on the python version, so we only
594- # check it produced the TypeError but not the specific message.
595- # assert ("'OMPLoopTrans' received options with the wrong types:\n"
596- # "'collapse' option expects type 'int | bool' but "
597- # "received 'x' of type 'str'.\n"
598- # "Please see the documentation and check the provided types."
599- # in str(excinfo.value))
594+ if sys .version_info >= (3 , 10 ):
595+ assert ("'OMPLoopTrans' received options with the wrong types:\n "
596+ "'collapse' option expects type 'int | bool' but "
597+ "received 'x' of type 'str'.\n "
598+ "Please see the documentation and check the provided types."
599+ in str (excinfo .value ))
600+ else :
601+ assert ("The 'collapse' argument must be an integer or a bool but got"
602+ " an object of type <class 'str'>"
603+ in str (excinfo .value ))
600604
601605
602606def test_omplooptrans_apply_nowait (fortran_reader , fortran_writer ):
You can’t perform that action at this time.
0 commit comments