From 5351bff23167d79ed12da722ee0d10f3abc1fdd7 Mon Sep 17 00:00:00 2001 From: Fabio Luporini Date: Tue, 17 Dec 2024 14:20:58 +0000 Subject: [PATCH] tests: Switch to pytest.raises --- devito/operator/operator.py | 2 +- tests/test_buffering.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/devito/operator/operator.py b/devito/operator/operator.py index b0666c6047..6a30557072 100644 --- a/devito/operator/operator.py +++ b/devito/operator/operator.py @@ -742,7 +742,7 @@ def arguments(self, **kwargs): # Check all arguments are present for p in self.parameters: if args.get(p.name) is None: - raise InvalidArgument(f"No value found for parameter `{p.name}`") + raise InvalidArgument(f"No value found for parameter {p.name}") return args # Code generation and JIT compilation diff --git a/tests/test_buffering.py b/tests/test_buffering.py index aebde40eff..c1196466e3 100644 --- a/tests/test_buffering.py +++ b/tests/test_buffering.py @@ -351,12 +351,8 @@ def define(self, dimensions): eqns = [Eq(u.forward, u + 1, subdomain=s_d0), Eq(u.forward, u.forward + 1, subdomain=s_d1)] - try: + with pytest.raises(CompilationError): Operator(eqns, opt='buffering') - except CompilationError: - assert True - except: - assert False @pytest.mark.xfail(reason="Cannot deal with non-overlapping SubDimensions yet")