Skip to content

Commit 1fdcb3a

Browse files
authored
TST: remove xfailing css tests (#16272)
1 parent 82b9a17 commit 1fdcb3a

File tree

2 files changed

+2
-91
lines changed

2 files changed

+2
-91
lines changed

pandas/tests/io/formats/test_css.py

+1-75
Original file line numberDiff line numberDiff line change
@@ -29,48 +29,14 @@ def test_css_parse_normalisation(name, norm, abnorm):
2929
assert_same_resolution(norm, abnorm)
3030

3131

32-
@pytest.mark.xfail(reason='CSS comments not yet stripped')
33-
def test_css_parse_comments():
34-
assert_same_resolution('hello: world',
35-
'hello/* foo */:/* bar \n */ world /*;not:here*/')
36-
37-
38-
@pytest.mark.xfail(reason='''we don't need to handle specificity
39-
markers like !important, but we should
40-
ignore them in the future''')
41-
def test_css_parse_specificity():
42-
assert_same_resolution('font-weight: bold', 'font-weight: bold !important')
43-
44-
45-
@pytest.mark.xfail(reason='Splitting CSS declarations not yet sensitive to '
46-
'; in CSS strings')
47-
def test_css_parse_strings():
48-
# semicolons in strings
49-
with tm.assert_produces_warning(CSSWarning):
50-
assert_resolves(
51-
'background-image: url(\'http://blah.com/foo?a;b=c\')',
52-
{'background-image': 'url(\'http://blah.com/foo?a;b=c\')'})
53-
assert_resolves(
54-
'background-image: url("http://blah.com/foo?a;b=c")',
55-
{'background-image': 'url("http://blah.com/foo?a;b=c")'})
56-
57-
5832
@pytest.mark.parametrize(
5933
'invalid_css,remainder', [
6034
# No colon
6135
('hello-world', ''),
6236
('border-style: solid; hello-world', 'border-style: solid'),
6337
('border-style: solid; hello-world; font-weight: bold',
6438
'border-style: solid; font-weight: bold'),
65-
# Unclosed string
66-
pytest.mark.xfail(('background-image: "abc', ''),
67-
reason='Unclosed CSS strings not detected'),
68-
pytest.mark.xfail(('font-family: "abc', ''),
69-
reason='Unclosed CSS strings not detected'),
70-
pytest.mark.xfail(('background-image: \'abc', ''),
71-
reason='Unclosed CSS strings not detected'),
72-
pytest.mark.xfail(('font-family: \'abc', ''),
73-
reason='Unclosed CSS strings not detected'),
39+
# Unclosed string fail
7440
# Invalid size
7541
('font-size: blah', 'font-size: 1em'),
7642
('font-size: 1a2b', 'font-size: 1em'),
@@ -124,46 +90,6 @@ def test_css_side_shorthands(shorthand, expansions):
12490
{})
12591

12692

127-
@pytest.mark.xfail(reason='CSS font shorthand not yet handled')
128-
@pytest.mark.parametrize('css,props', [
129-
('font: italic bold 12pt helvetica,sans-serif',
130-
{'font-family': 'helvetica,sans-serif',
131-
'font-style': 'italic',
132-
'font-weight': 'bold',
133-
'font-size': '12pt'}),
134-
('font: bold italic 12pt helvetica,sans-serif',
135-
{'font-family': 'helvetica,sans-serif',
136-
'font-style': 'italic',
137-
'font-weight': 'bold',
138-
'font-size': '12pt'}),
139-
])
140-
def test_css_font_shorthand(css, props):
141-
assert_resolves(css, props)
142-
143-
144-
@pytest.mark.xfail(reason='CSS background shorthand not yet handled')
145-
@pytest.mark.parametrize('css,props', [
146-
('background: blue', {'background-color': 'blue'}),
147-
('background: fixed blue',
148-
{'background-color': 'blue', 'background-attachment': 'fixed'}),
149-
])
150-
def test_css_background_shorthand(css, props):
151-
assert_resolves(css, props)
152-
153-
154-
@pytest.mark.xfail(reason='CSS border shorthand not yet handled')
155-
@pytest.mark.parametrize('style,equiv', [
156-
('border: 1px solid red',
157-
'border-width: 1px; border-style: solid; border-color: red'),
158-
('border: solid red 1px',
159-
'border-width: 1px; border-style: solid; border-color: red'),
160-
('border: red solid',
161-
'border-style: solid; border-color: red'),
162-
])
163-
def test_css_border_shorthand(style, equiv):
164-
assert_same_resolution(style, equiv)
165-
166-
16793
@pytest.mark.parametrize('style,inherited,equiv', [
16894
('margin: 1px; margin: 2px', '',
16995
'margin: 2px'),

pandas/tests/io/formats/test_to_excel.py

+1-16
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,7 @@
7373
('text-shadow: 0px -0em 2px #CCC', {'font': {'shadow': True}}),
7474
('text-shadow: 0px -0em 2px', {'font': {'shadow': True}}),
7575
('text-shadow: 0px -2em', {'font': {'shadow': True}}),
76-
pytest.mark.xfail(('text-shadow: #CCC 3px 3px 3px',
77-
{'font': {'shadow': True}}),
78-
reason='text-shadow with color preceding width not yet '
79-
'identified as shadow'),
80-
pytest.mark.xfail(('text-shadow: #999 0px 0px 0px',
81-
{'font': {'shadow': False}}),
82-
reason='text-shadow with color preceding zero width not '
83-
'yet identified as non-shadow'),
76+
8477
# FILL
8578
# - color, fillType
8679
('background-color: red', {'fill': {'fgColor': 'FF0000',
@@ -209,11 +202,3 @@ def test_css_to_excel_multiple():
209202
def test_css_to_excel_inherited(css, inherited, expected):
210203
convert = CSSToExcelConverter(inherited)
211204
assert expected == convert(css)
212-
213-
214-
@pytest.mark.xfail(reason='We are not currently warning for all unconverted '
215-
'CSS, but possibly should')
216-
def test_css_to_excel_warns_when_not_supported():
217-
convert = CSSToExcelConverter()
218-
with pytest.warns(UserWarning):
219-
convert('background: red')

0 commit comments

Comments
 (0)