From 2d033d0e0f45ce11b2b3a9981fd94e7a77fe1715 Mon Sep 17 00:00:00 2001 From: Darren Burns Date: Thu, 16 Jun 2022 14:33:27 +0100 Subject: [PATCH] Checking empty rules --- tests/css/test_stylesheet.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/css/test_stylesheet.py b/tests/css/test_stylesheet.py index 5bb78dc80..d8d067cd9 100644 --- a/tests/css/test_stylesheet.py +++ b/tests/css/test_stylesheet.py @@ -23,6 +23,17 @@ def test_stylesheet_apply_takes_final_rule_in_specificity_clash(): assert node.styles.background == Color(0, 0, 255) # background: blue +def test_stylesheet_apply_empty_rules(): + css = ".a {} .b {}" + + stylesheet = Stylesheet() + stylesheet.source["test.css"] = css + stylesheet.parse() + + node = DOMNode(classes="a b") + stylesheet.apply(node) + + @pytest.mark.parametrize( "css_value,expectation,expected_color", [