Skip to content

Commit

Permalink
improve test condition
Browse files Browse the repository at this point in the history
  • Loading branch information
will-cromar committed May 16, 2024
1 parent 02d8f9f commit ae0f791
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions test/test_devices.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,10 @@ def test_step(self):
self.assertEqual(met.counter_value('MarkStep'), 1)

def test_step_exception(self):
try:
with self.assertRaisesRegex(RuntimeError, 'Expected error'):
with xla.step():
torch.ones((3, 3), device=xla.device())
raise RuntimeError("Expected error")
except RuntimeError:
pass
raise RuntimeError('Expected error')

self.assertEqual(met.counter_value('MarkStep'), 1)

Expand Down

0 comments on commit ae0f791

Please sign in to comment.