From 62679715f847a75270d40af9adf476428b3a3db8 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 13c86047cd..ccfa5a249f 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")