From 821d753893a0f399b2927e05b4334a8f2b522ad5 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 22 Nov 2024 14:36:30 +0000 Subject: [PATCH 1/3] Loki: Turn test sub-directories into sub-packages --- loki/analyse/tests/__init__.py | 6 ++++++ loki/backend/tests/__init__.py | 6 ++++++ loki/batch/tests/__init__.py | 6 ++++++ loki/build/tests/__init__.py | 6 ++++++ loki/expression/tests/__init__.py | 6 ++++++ loki/frontend/tests/__init__.py | 6 ++++++ loki/ir/tests/__init__.py | 6 ++++++ loki/tests/__init__.py | 6 ++++++ loki/tools/tests/__init__.py | 6 ++++++ 9 files changed, 54 insertions(+) create mode 100644 loki/analyse/tests/__init__.py create mode 100644 loki/backend/tests/__init__.py create mode 100644 loki/batch/tests/__init__.py create mode 100644 loki/build/tests/__init__.py create mode 100644 loki/expression/tests/__init__.py create mode 100644 loki/frontend/tests/__init__.py create mode 100644 loki/ir/tests/__init__.py create mode 100644 loki/tests/__init__.py create mode 100644 loki/tools/tests/__init__.py diff --git a/loki/analyse/tests/__init__.py b/loki/analyse/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/analyse/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. diff --git a/loki/backend/tests/__init__.py b/loki/backend/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/backend/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. diff --git a/loki/batch/tests/__init__.py b/loki/batch/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/batch/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. diff --git a/loki/build/tests/__init__.py b/loki/build/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/build/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. diff --git a/loki/expression/tests/__init__.py b/loki/expression/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/expression/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. diff --git a/loki/frontend/tests/__init__.py b/loki/frontend/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/frontend/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. diff --git a/loki/ir/tests/__init__.py b/loki/ir/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/ir/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. diff --git a/loki/tests/__init__.py b/loki/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. diff --git a/loki/tools/tests/__init__.py b/loki/tools/tests/__init__.py new file mode 100644 index 000000000..538bb4e73 --- /dev/null +++ b/loki/tools/tests/__init__.py @@ -0,0 +1,6 @@ +# (C) Copyright 2018- ECMWF. +# This software is licensed under the terms of the Apache Licence Version 2.0 +# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0. +# In applying this licence, ECMWF does not waive the privileges and immunities +# granted to it by virtue of its status as an intergovernmental organisation +# nor does it submit to any jurisdiction. From 95e15a4e7378e289113048507c8e07f7ea0df3d4 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 22 Nov 2024 15:08:40 +0000 Subject: [PATCH 2/3] Loki: Appeasing linter gods with many a goat sacrifice The "system" works! Happy Friday, B.! --- loki/backend/tests/test_fgen.py | 2 +- loki/batch/tests/test_batch.py | 5 ++ loki/build/tests/test_build.py | 7 +-- loki/ir/tests/test_control_flow.py | 1 - loki/ir/tests/test_ir_nodes.py | 76 +++++++++++++++--------------- loki/ir/tests/test_pragma_utils.py | 4 +- loki/ir/tests/test_scoped_nodes.py | 2 +- loki/program_unit.py | 2 +- loki/tests/test_dimension.py | 4 +- loki/tests/test_modules.py | 8 ++-- loki/tests/test_subroutine.py | 4 +- 11 files changed, 61 insertions(+), 54 deletions(-) diff --git a/loki/backend/tests/test_fgen.py b/loki/backend/tests/test_fgen.py index 7895b869b..e3700209d 100644 --- a/loki/backend/tests/test_fgen.py +++ b/loki/backend/tests/test_fgen.py @@ -11,7 +11,7 @@ from loki.backend import fgen from loki.expression import symbols as sym from loki.frontend import available_frontends, OMNI -from loki.ir import Intrinsic, DataDeclaration +from loki.ir import DataDeclaration from loki.types import ProcedureType, BasicType diff --git a/loki/batch/tests/test_batch.py b/loki/batch/tests/test_batch.py index a402d25b3..7abf47d90 100644 --- a/loki/batch/tests/test_batch.py +++ b/loki/batch/tests/test_batch.py @@ -402,6 +402,7 @@ def test_procedure_item1(testdir): # To ensure any existing items from the item_cache are re-used, we instantiate one for # the procedure binding + # pylint: disable=unsupported-binary-operation t_mod_t_proc = get_item( ProcedureBindingItem, proj/'module/t_mod.F90', 't_mod#t%proc', RegexParserClass.ProgramUnitClass | RegexParserClass.TypeDefClass | RegexParserClass.DeclarationClass @@ -805,6 +806,7 @@ def test_interface_item_in_subroutine(testdir): def test_procedure_binding_item1(testdir): proj = testdir/'sources/projBatch' + # pylint: disable=unsupported-binary-operation parser_classes = ( RegexParserClass.ProgramUnitClass | RegexParserClass.TypeDefClass | RegexParserClass.DeclarationClass ) @@ -830,6 +832,7 @@ def test_procedure_binding_item1(testdir): def test_procedure_binding_item2(testdir, default_config): proj = testdir/'sources/projBatch' + # pylint: disable=unsupported-binary-operation parser_classes = ( RegexParserClass.ProgramUnitClass | RegexParserClass.TypeDefClass | RegexParserClass.DeclarationClass ) @@ -871,6 +874,7 @@ def test_procedure_binding_item2(testdir, default_config): def test_procedure_binding_item3(testdir): proj = testdir/'sources/projBatch' + # pylint: disable=unsupported-binary-operation parser_classes = ( RegexParserClass.ProgramUnitClass | RegexParserClass.TypeDefClass | RegexParserClass.DeclarationClass ) @@ -909,6 +913,7 @@ def test_procedure_binding_item3(testdir): ]) def test_procedure_binding_with_config(testdir, config, expected_dependencies): proj = testdir/'sources/projBatch' + # pylint: disable=unsupported-binary-operation parser_classes = ( RegexParserClass.ProgramUnitClass | RegexParserClass.TypeDefClass | RegexParserClass.DeclarationClass ) diff --git a/loki/build/tests/test_build.py b/loki/build/tests/test_build.py index 862784c64..a4d0a61b7 100644 --- a/loki/build/tests/test_build.py +++ b/loki/build/tests/test_build.py @@ -8,9 +8,10 @@ from pathlib import Path import pytest -from loki.build import ( - Obj, Lib, Builder, - Compiler, GNUCompiler, NvidiaCompiler, get_compiler_from_env, _default_compiler +from loki.build import Obj, Lib, Builder +from loki.build.compiler import ( + Compiler, GNUCompiler, NvidiaCompiler, get_compiler_from_env, + _default_compiler ) diff --git a/loki/ir/tests/test_control_flow.py b/loki/ir/tests/test_control_flow.py index c2f75240d..2e95aaec2 100644 --- a/loki/ir/tests/test_control_flow.py +++ b/loki/ir/tests/test_control_flow.py @@ -583,7 +583,6 @@ def test_single_line_forall_masked_stmt(tmp_path, frontend): assert bound_var == "j" assert bound_range == '1:n' # Check the array mask - mask = statements[0].mask assert statements[0].mask == 'a(i, j) != 0.0' # Quickly check assignment assignments = FindNodes(ir.Assignment).visit(statements[0]) diff --git a/loki/ir/tests/test_ir_nodes.py b/loki/ir/tests/test_ir_nodes.py index 3d3cad8dd..9c56ea6aa 100644 --- a/loki/ir/tests/test_ir_nodes.py +++ b/loki/ir/tests/test_ir_nodes.py @@ -5,9 +5,9 @@ # granted to it by virtue of its status as an intergovernmental organisation # nor does it submit to any jurisdiction. -import pytest - from dataclasses import FrozenInstanceError + +import pytest from pymbolic.primitives import Expression from pydantic import ValidationError @@ -52,17 +52,17 @@ def test_assignment(scope, a_i): assert assign.comment is None # Ensure "frozen" status of node objects - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): assign.lhs = sym.Scalar('b', scope=scope) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): assign.rhs = sym.Scalar('b', scope=scope) # Test errors for wrong contructor usage - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.Assignment(lhs='a', rhs=sym.Literal(42.0)) - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.Assignment(lhs=a_i, rhs='42.0 + 6.0') - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.Assignment(lhs=a_i, rhs=sym.Literal(42.0), comment=a_i) @@ -81,11 +81,11 @@ def test_loop(scope, one, i, n, a_i): assert loop.children == ( i, bounds, (assign,) ) # Ensure "frozen" status of node objects - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): loop.variable = sym.Scalar('j', scope=scope) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): loop.bounds = sym.Range((n, sym.Scalar('k', scope=scope))) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): loop.body = (assign, assign, assign) # Test auto-casting of the body to tuple @@ -97,17 +97,17 @@ def test_loop(scope, one, i, n, a_i): assert loop.body == (assign, assign, assign) # Test errors for wrong contructor usage - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.Loop(variable=i, bounds=bounds, body=n) - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.Loop(variable=None, bounds=bounds, body=(assign,)) - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.Loop(variable=i, bounds=None, body=(assign,)) # TODO: Test pragmas, names and labels -def test_conditional(scope, one, i, n, a_i): +def test_conditional(scope, n, a_i): """ Test constructors of :any:`Conditional`. """ @@ -124,34 +124,34 @@ def test_conditional(scope, one, i, n, a_i): assert all(isinstance(n, ir.Node) for n in cond.else_body) assert cond.children == ( condition, (assign, assign), (assign,) ) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): cond.condition = parse_expr('k == 0', scope=scope) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): cond.body = (assign, assign, assign) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): cond.else_body = (assign, assign, assign) # Test auto-casting of the body / else_body to tuple cond = ir.Conditional(condition=condition, body=assign) - assert cond.body == (assign,) and cond.else_body == () + assert cond.body == (assign,) and not cond.else_body cond = ir.Conditional(condition=condition, body=( (assign,), )) - assert cond.body == (assign,) and cond.else_body == () + assert cond.body == (assign,) and not cond.else_body cond = ir.Conditional(condition=condition, body=( assign, (assign,), assign, None)) - assert cond.body == (assign, assign, assign) and cond.else_body == () + assert cond.body == (assign, assign, assign) and not cond.else_body cond = ir.Conditional(condition=condition, body=(), else_body=assign) - assert cond.body == () and cond.else_body == (assign,) + assert not cond.body and cond.else_body == (assign,) cond = ir.Conditional(condition=condition, body=(), else_body=( (assign,), )) - assert cond.body == () and cond.else_body == (assign,) + assert not cond.body and cond.else_body == (assign,) cond = ir.Conditional( condition=condition, body=(), else_body=( assign, (assign,), assign, None) ) - assert cond.body == () and cond.else_body == (assign, assign, assign) + assert not cond.body and cond.else_body == (assign, assign, assign) # TODO: Test inline, name, has_elseif -def test_multi_conditional(scope, one, i, n, a_i): +def test_multi_conditional(i, a_i): """ Test nested chains of constructors of :any:`Conditional` to form multi-conditional. @@ -199,7 +199,7 @@ def test_multi_conditional(scope, one, i, n, a_i): assert else_bodies[1][0].lhs == 'a(i)' and else_bodies[1][0].rhs == '1.0' -def test_section(scope, one, i, n, a_n, a_i): +def test_section(n, a_n, a_i): """ Test constructors and behaviour of :any:`Section` nodes. """ @@ -213,13 +213,13 @@ def test_section(scope, one, i, n, a_n, a_i): sec = ir.Section(body=(assign, assign)) assert isinstance(sec.body, tuple) and len(sec.body) == 2 assert all(isinstance(n, ir.Node) for n in sec.body) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): sec.body = (assign, assign) sec = ir.Section(body=(func, func)) assert isinstance(sec.body, tuple) and len(sec.body) == 2 assert all(isinstance(n, Scope) for n in sec.body) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): sec.body = (func, func) sec = ir.Section((assign, assign)) @@ -264,29 +264,29 @@ def test_callstatement(scope, one, i, n, a_i): ) # Ensure "frozen" status of node objects - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): call.name = sym.ProcedureSymbol('dave', scope=scope) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): call.arguments = (a_i, n, one) - with pytest.raises(FrozenInstanceError) as error: + with pytest.raises(FrozenInstanceError): call.kwarguments = (('i', one), ('j', i)) # Test auto-casting of the body to tuple call = ir.CallStatement(name=cname, arguments=[a_i, one]) - assert call.arguments == (a_i, one) and call.kwarguments == () + assert call.arguments == (a_i, one) and not call.kwarguments call = ir.CallStatement(name=cname, arguments=None) - assert call.arguments == () and call.kwarguments == () + assert not call.arguments and not call.kwarguments call = ir.CallStatement(name=cname, kwarguments=[('i', i), ('j', one)]) - assert call.arguments == () and call.kwarguments == (('i', i), ('j', one)) + assert not call.arguments and call.kwarguments == (('i', i), ('j', one)) call = ir.CallStatement(name=cname, kwarguments=None) - assert call.arguments == () and call.kwarguments == () + assert not call.arguments and not call.kwarguments # Test errors for wrong contructor usage - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.CallStatement(name='a', arguments=(sym.Literal(42.0),)) - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.CallStatement(name=cname, arguments=('a',)) - with pytest.raises(ValidationError) as error: + with pytest.raises(ValidationError): ir.Assignment( name=cname, arguments=(sym.Literal(42.0),), kwarguments=('i', 'i') ) @@ -304,7 +304,7 @@ def test_associate(scope, a_i): assign = ir.Assignment(lhs=a_i, rhs=sym.Literal(42.0)) assign2 = ir.Assignment(lhs=a_i.clone(parent=b), rhs=sym.Literal(66.6)) - assoc = ir.Associate(associations=((b_a, a),), body=(assign, assign2), parent=scope) + assoc = ir.Associate(associations=((b_a, a),), body=(assign, assign2), parent=scope) # pylint: disable=unexpected-keyword-arg assert isinstance(assoc.associations, tuple) assert all(isinstance(n, tuple) and len(n) == 2 for n in assoc.associations) assert isinstance(assoc.body, tuple) diff --git a/loki/ir/tests/test_pragma_utils.py b/loki/ir/tests/test_pragma_utils.py index f785a67f2..df6000c72 100644 --- a/loki/ir/tests/test_pragma_utils.py +++ b/loki/ir/tests/test_pragma_utils.py @@ -95,7 +95,7 @@ def test_get_pragma_parameters_multiline(frontend): assert pragmas[0].keyword == 'OMP' params = get_pragma_parameters(pragmas[0], only_loki_pragmas=False) assert len(params) == 3 - assert params['PARALLEL'] == None + assert params['PARALLEL'] is None assert params['PRIVATE'].strip() == 'i, j' assert params['FIRSTPRIVATE'].strip() == 'n, a, b' @@ -656,7 +656,7 @@ def test_pragmas_mixed_key_value_attrs(frontend): routine = Subroutine.from_source(fcode, frontend=frontend) - pragma = Pragma(keyword='acc', content=f'kernels num_gangs ( 1 ) async wait') + pragma = Pragma(keyword='acc', content='kernels num_gangs ( 1 ) async wait') assert get_pragma_parameters(pragma, only_loki_pragmas=False) == { 'kernels': None, 'num_gangs': ' 1 ', diff --git a/loki/ir/tests/test_scoped_nodes.py b/loki/ir/tests/test_scoped_nodes.py index d3bca5a4e..49a73be14 100644 --- a/loki/ir/tests/test_scoped_nodes.py +++ b/loki/ir/tests/test_scoped_nodes.py @@ -50,7 +50,7 @@ def test_scoped_node_get_symbols(frontend, tmp_path): assert routine.get_symbol('b') == 'b(n)' assert routine.get_symbol('b').scope == routine assert routine.get_symbol('c') == 'c' - assert routine.get_symbol('c').scope == routine + assert routine.get_symbol('c').scope == routine assert routine.get_symbol('jprb') == 'jprb' assert routine.get_symbol('jprb').scope == module assert routine.get_symbol('jprb').initial == 8 diff --git a/loki/program_unit.py b/loki/program_unit.py index 5c503811c..b7b51a072 100644 --- a/loki/program_unit.py +++ b/loki/program_unit.py @@ -78,7 +78,7 @@ def __initialize__(self, name, docstring=None, spec=None, contains=None, if not isinstance(contains, ir.Section): contains = ir.Section(body=as_tuple(contains)) for node in contains.body: - if isinstance(node, ir.Intrinsic) and 'contains' in node.text.lower(): + if isinstance(node, ir.Intrinsic) and 'contains' in node.text.lower(): # pylint: disable=no-member break if isinstance(node, ProgramUnit): contains.prepend(ir.Intrinsic(text='CONTAINS')) diff --git a/loki/tests/test_dimension.py b/loki/tests/test_dimension.py index 0b5782fe5..7e767a25a 100644 --- a/loki/tests/test_dimension.py +++ b/loki/tests/test_dimension.py @@ -154,5 +154,5 @@ def test_dimension_config(tmp_path): assert dim_b.size == nblocks assert dim_b.index == ibl assert dim_b.bounds == (sym.IntLiteral(1), nblocks) - assert dim_b.lower == (one, start, start.clone(parent=dim)) - assert dim_b.upper == (nblocks, end, end.clone(parent=dim)) + assert dim_b.lower == (one, start, start.clone(parent=dim)) # pylint: disable=no-member + assert dim_b.upper == (nblocks, end, end.clone(parent=dim)) # pylint: disable=no-member diff --git a/loki/tests/test_modules.py b/loki/tests/test_modules.py index 7914fd1cf..a8397f75a 100644 --- a/loki/tests/test_modules.py +++ b/loki/tests/test_modules.py @@ -872,8 +872,8 @@ def test_module_rename_imports_no_definitions(frontend, tmp_path): end module test_other_rename_mod """.strip() - mod1 = Module.from_source(fcode_mod1, frontend=frontend, xmods=[tmp_path]) - mod2 = Module.from_source(fcode_mod2, frontend=frontend, xmods=[tmp_path]) + _ = Module.from_source(fcode_mod1, frontend=frontend, xmods=[tmp_path]) + _ = Module.from_source(fcode_mod2, frontend=frontend, xmods=[tmp_path]) fcode_mod3 = """ module some_mod @@ -1306,7 +1306,9 @@ def test_module_all_imports(frontend, tmp_path): header_a = Module.from_source(fcode['header_a'], frontend=frontend, xmods=[tmp_path]) header_b = Module.from_source(fcode['header_b'], frontend=frontend, xmods=[tmp_path]) - routine_mod = Module.from_source(fcode['routine'], definitions=(header_a, header_b), frontend=frontend, xmods=[tmp_path]) + routine_mod = Module.from_source( + fcode['routine'], definitions=(header_a, header_b), frontend=frontend, xmods=[tmp_path] + ) routine = routine_mod['routine'] assert routine_mod.parents == () diff --git a/loki/tests/test_subroutine.py b/loki/tests/test_subroutine.py index 3ab9f309a..32dc9d79d 100644 --- a/loki/tests/test_subroutine.py +++ b/loki/tests/test_subroutine.py @@ -2274,8 +2274,8 @@ def test_resolve_typebound_var(frontend, tmp_path): # Instead, we can creatae a deferred type variable in the scope and # resolve members relative to it not_tt = Variable(name='not_tt', scope=routine) - assert not_tt.type.dtype == BasicType.DEFERRED - not_tt_invalid = not_tt.get_derived_type_member('invalid') + assert not_tt.type.dtype == BasicType.DEFERRED # pylint: disable=no-member + not_tt_invalid = not_tt.get_derived_type_member('invalid') # pylint: disable=no-member assert not_tt_invalid == 'not_tt%invalid' assert not_tt_invalid.type.dtype == BasicType.DEFERRED From 3e0e8abe185e07d61a0b41099fffed77aa62d9c1 Mon Sep 17 00:00:00 2001 From: Michael Lange Date: Fri, 22 Nov 2024 18:32:43 +0000 Subject: [PATCH 3/3] Batch: Adjust pipeline test to new test package names --- loki/batch/tests/test_transformation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/loki/batch/tests/test_transformation.py b/loki/batch/tests/test_transformation.py index c410441c1..a69a42f05 100644 --- a/loki/batch/tests/test_transformation.py +++ b/loki/batch/tests/test_transformation.py @@ -629,8 +629,8 @@ def transform_subroutine(self, routine, **kwargs): assert comments[4].text == '! No !' # Check that the string representation is sane - assert '