Skip to content

Commit

Permalink
flake8 updates...
Browse files Browse the repository at this point in the history
  • Loading branch information
SCHREIBER Martin committed Jan 8, 2025
1 parent 190b791 commit a2f6567
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions src/psyclone/parse/file_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -549,4 +550,3 @@ def get_psyir(
# self._cache_save(verbose=verbose)

return self._psyir_node

1 change: 1 addition & 0 deletions src/psyclone/parse/module_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 5 additions & 4 deletions src/psyclone/tests/parse/file_info_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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()


Expand All @@ -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)

0 comments on commit a2f6567

Please sign in to comment.