From 168b0670c4a717232c6c82fb8149c448479bbd8e Mon Sep 17 00:00:00 2001 From: Keerthan Jaic Date: Sat, 27 Jun 2015 04:39:33 -0400 Subject: [PATCH] test_modbv: simplify some tests using pytest.raises --- myhdl/test/core/test_modbv.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/myhdl/test/core/test_modbv.py b/myhdl/test/core/test_modbv.py index e4cc5baf..395b2ce8 100644 --- a/myhdl/test/core/test_modbv.py +++ b/myhdl/test/core/test_modbv.py @@ -63,15 +63,9 @@ class TestModbvWrap: def testNoWrap(self): # Validate the base class fails for the wraps x = intbv(0, min=-8, max=8) - try: + with pytest.raises(ValueError): x[:] += 15 - raise AssertionError - except ValueError: - pass x = intbv(0, min=-8, max=8) - try: + with pytest.raises(ValueError): x[:] += 15 - raise AssertionError - except ValueError: - pass