File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -66,21 +66,27 @@ def test_bad_attribute(self):
6666 def test_bad_attribute_unclused (self ):
6767 """Test bad attribute fails for syntax error, not timeout error."""
6868
69- import signal
69+ import platform
7070
71- def timeout_handler (signum , frame ):
72- raise TimeoutError
73-
74- signal .signal (signal .SIGALRM , timeout_handler )
75- signal .alarm (3 )
76-
77- passed = False
78- try :
71+ if platform .system () == 'Windows' :
7972 with self .assertRaises (sv .SelectorSyntaxError ):
8073 sv .compile ('[a="' + ('x' * 300 ))
81- passed = True
82- except TimeoutError :
83- pass
84- finally :
85- signal .alarm (0 )
86- self .assertTrue (passed )
74+ else :
75+ import signal
76+
77+ def timeout_handler (signum , frame ):
78+ raise TimeoutError
79+
80+ signal .signal (signal .SIGALRM , timeout_handler )
81+ signal .alarm (3 )
82+
83+ passed = False
84+ try :
85+ with self .assertRaises (sv .SelectorSyntaxError ):
86+ sv .compile ('[a="' + ('x' * 300 ))
87+ passed = True
88+ except TimeoutError :
89+ pass
90+ finally :
91+ signal .alarm (0 )
92+ self .assertTrue (passed )
You can’t perform that action at this time.
0 commit comments