@@ -1106,10 +1106,8 @@ def test_shape(self):
11061106 self .assertEqual (s8 .shape (), signed (5 ))
11071107 s9 = Signal (range (- 20 , 16 ))
11081108 self .assertEqual (s9 .shape (), signed (6 ))
1109- with warnings .catch_warnings ():
1110- warnings .filterwarnings (action = "ignore" , category = SyntaxWarning )
1111- s10 = Signal (range (0 ))
1112- self .assertEqual (s10 .shape (), unsigned (0 ))
1109+ s10 = Signal (range (0 ))
1110+ self .assertEqual (s10 .shape (), unsigned (0 ))
11131111 s11 = Signal (range (1 ))
11141112 self .assertEqual (s11 .shape (), unsigned (1 ))
11151113
@@ -1184,10 +1182,22 @@ def test_reset_wrong_too_wide(self):
11841182 Signal (signed (1 ), reset = - 2 )
11851183
11861184 def test_reset_wrong_fencepost (self ):
1187- with self .assertWarnsRegex ( SyntaxWarning ,
1185+ with self .assertRaisesRegex ( SyntaxError ,
11881186 r"^Reset value 10 equals the non-inclusive end of the signal shape "
11891187 r"range\(0, 10\); this is likely an off-by-one error$" ):
11901188 Signal (range (0 , 10 ), reset = 10 )
1189+ with self .assertRaisesRegex (SyntaxError ,
1190+ r"^Reset value 0 equals the non-inclusive end of the signal shape "
1191+ r"range\(0, 0\); this is likely an off-by-one error$" ):
1192+ Signal (range (0 ), reset = 0 )
1193+
1194+ def test_reset_wrong_range (self ):
1195+ with self .assertRaisesRegex (SyntaxError ,
1196+ r"^Reset value 11 is not within the signal shape range\(0, 10\)$" ):
1197+ Signal (range (0 , 10 ), reset = 11 )
1198+ with self .assertRaisesRegex (SyntaxError ,
1199+ r"^Reset value 0 is not within the signal shape range\(1, 10\)$" ):
1200+ Signal (range (1 , 10 ), reset = 0 )
11911201
11921202 def test_attrs (self ):
11931203 s1 = Signal ()
0 commit comments