File tree 1 file changed +9
-10
lines changed
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):
138
138
) # attr, colon, value, semicolon
139
139
140
140
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 ))
151
150
152
151
def test_selector_str_tag (self ):
153
152
(rule ,) = parse_stylesheet ("html {}" )
You can’t perform that action at this time.
0 commit comments