@@ -121,7 +121,7 @@ def test_setting_with_tolerance(self, test_object):
121
121
assert not test_object .validate_value (toobig ), (
122
122
"Too-big value %s validates as OK" % toobig
123
123
)
124
- with pytest .raises (ValueError ):
124
+ with pytest .raises (ValueError , match = r"Invalid value [\d\.]*" ):
125
125
test_object .set_value (toobig , timeout = None )
126
126
127
127
# Must be set first so the next command causes a change
@@ -158,7 +158,7 @@ def test_setting_timeouts_1(self, test_object):
158
158
159
159
# Must be set first so the next command causes a change
160
160
test_object .set_value (low , timeout = 90 )
161
- with pytest .raises (Exception ):
161
+ with pytest .raises (RuntimeError ):
162
162
test_object .set_value (high , timeout = 1.0e-6 )
163
163
164
164
def test_setting_timeouts_2 (self , test_object ):
@@ -174,7 +174,7 @@ def test_setting_timeouts_2(self, test_object):
174
174
175
175
# Must be set first so the next command causes a change
176
176
test_object .set_value (high , timeout = None )
177
- with pytest .raises (Exception ):
177
+ with pytest .raises (RuntimeError ):
178
178
test_object .set_value (low , timeout = 0 )
179
179
test_object .wait_ready (timeout = 1.0e-6 )
180
180
0 commit comments