File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -138,16 +138,15 @@ def test_skip_whitespace(self):
138138 ) # attr, colon, value, semicolon
139139
140140 def test_has_shadow (self ):
141- (rule ,) = parse_stylesheet ("html {box-shadow: 10px 5px 5px red;}" )
142- self .assertTrue (has_shadow (rule ))
143-
144- def test_has_shadow_with_box_shadow_none (self ):
145- (rule ,) = parse_stylesheet ("html {box-shadow: none;}" )
146- self .assertFalse (has_shadow (rule ))
147-
148- def test_has_shadow_empty_rule (self ):
149- (rule ,) = parse_stylesheet ("html {}" )
150- self .assertFalse (has_shadow (rule ))
141+ for expected , css in [
142+ (True , "html {box-shadow: 10px 5px 5px red;}" ),
143+ (False , "html {box-shadow: none;}" ),
144+ (False , "html {}" ),
145+ ]:
146+ with self .subTest (css = css , expected = expected ):
147+ (rule ,) = parse_stylesheet (css )
148+ assert_method = self .assertTrue if expected else self .assertFalse
149+ assert_method (has_shadow (rule ))
151150
152151 def test_selector_str_tag (self ):
153152 (rule ,) = parse_stylesheet ("html {}" )
You can’t perform that action at this time.
0 commit comments