Skip to content

Commit 3083c52

Browse files
author
Theofilos Manitaras
committed
Move assertion inside the with block
1 parent 1a8a7c4 commit 3083c52

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

unittests/test_policies.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -288,17 +288,14 @@ def _runall(checks, ns):
288288
time.sleep(0.2)
289289
p.terminate()
290290
p.join()
291-
exc = ns.exc
292-
num_cases = ns.num_cases
293-
num_failures = ns.num_failures
294-
295-
# Either the test is submitted and it fails due to the termination
296-
# or it is not yet submitted when the termination signal is sent
297-
assert (num_cases, num_failures) in {(1, 1), (0, 0)}
298-
with pytest.raises(ReframeForceExitError,
299-
match='received TERM signal'):
300-
if exc:
301-
raise exc
291+
292+
# Either the test is submitted and it fails due to the termination
293+
# or it is not yet submitted when the termination signal is sent
294+
assert (ns.num_cases, ns.num_failures) in {(1, 1), (0, 0)}
295+
with pytest.raises(ReframeForceExitError,
296+
match='received TERM signal'):
297+
if ns.exc:
298+
raise ns.exc
302299

303300
def test_dependencies_with_retries(self):
304301
self.runner._max_retries = 2

0 commit comments

Comments
 (0)