diff --git a/src/psyclone/parse/file_info.py b/src/psyclone/parse/file_info.py index b30221aab2..f2c83d7a52 100644 --- a/src/psyclone/parse/file_info.py +++ b/src/psyclone/parse/file_info.py @@ -461,7 +461,8 @@ def get_fparser_tree( f"File '{self._filename}' not found:\n{str(err)}") if self._source_code_hash_sum is None: - raise PSycloneError("Hash sum should be set after loading the source") + raise PSycloneError( + "Hash sum should be set after loading the source") # Check for cache self._cache_load(verbose=verbose) @@ -549,4 +550,3 @@ def get_psyir( # self._cache_save(verbose=verbose) return self._psyir_node - diff --git a/src/psyclone/parse/module_info.py b/src/psyclone/parse/module_info.py index d8cab4a1c2..906eb6b2ee 100644 --- a/src/psyclone/parse/module_info.py +++ b/src/psyclone/parse/module_info.py @@ -54,6 +54,7 @@ from fparser.two.Fortran2003 import Program + class ModuleInfoError(PSycloneError): """ PSyclone-specific exception for use when an error with the module manager diff --git a/src/psyclone/tests/parse/file_info_test.py b/src/psyclone/tests/parse/file_info_test.py index e02f3457d0..d89ef15bb2 100644 --- a/src/psyclone/tests/parse/file_info_test.py +++ b/src/psyclone/tests/parse/file_info_test.py @@ -344,7 +344,8 @@ def test_file_info_source_with_bugs(tmpdir): with pytest.raises(FileInfoFParserError) as einfo: file_info.get_psyir(verbose=True) - assert "FileInfoFParserError: Failed to create fparser tree: at line 5" in ( + assert ("FileInfoFParserError: Failed to create" + "fparser tree: at line 5") in ( str(einfo.value)) # Call it a 2nd time for coverage of not attempting to create it a 2nd time @@ -503,7 +504,7 @@ def test_fparser_error(): # Catch special exception from psyclone.parse.file_info import FileInfoFParserError - with pytest.raises(FileInfoFParserError) as einfo: + with pytest.raises(FileInfoFParserError): file_info.get_fparser_tree() @@ -519,5 +520,5 @@ def get_source_code(): with pytest.raises(PSycloneError) as einfo: file_info.get_fparser_tree() - assert "Hash sum should be set after loading the source" in str(einfo.value) - + assert ("Hash sum should be set after loading" + " the source") in str(einfo.value)