1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-10-04 07:57:52 +03:00

Mark expected failing tests as xfail

This commit is contained in:
Guillaume Ayoub 2020-12-10 23:05:44 +01:00
parent 30c21d92e9
commit 3798b220d6
6 changed files with 26 additions and 0 deletions

View File

@ -8,6 +8,7 @@
import io
import pytest
from PIL import Image
from weasyprint import HTML
@ -15,8 +16,10 @@ from .test_draw import assert_pixels_equal
from .testing_utils import assert_no_logs, capture_logs, resource_filename
@pytest.mark.xfail
@assert_no_logs
def test_acid2():
# TODO: fails because of Ghostscript rendering
def render(filename):
return HTML(resource_filename(filename)).render()

View File

@ -95,6 +95,7 @@ table = '''
'''
@pytest.mark.xfail
@assert_no_logs
@pytest.mark.parametrize('filename, image', (
('pattern.svg', centered_image),
@ -104,6 +105,7 @@ table = '''
('blue.jpg', blue_image)
))
def test_images(filename, image):
# TODO: fails because of missing SVG support
assert_pixels('inline_image_' + filename, 8, 8, image, '''
<style>
@page { size: 8px }
@ -149,8 +151,10 @@ def test_images_no_src():
<div><img alt=""></div>''')
@pytest.mark.xfail
@assert_no_logs
def test_images_alt():
# TODO: fails because of missing SVG support
with capture_logs() as logs:
assert_same_rendering(200, 30, [
(name, '''

View File

@ -1032,8 +1032,10 @@ def test_tables_14():
'''})
@pytest.mark.xfail
@assert_no_logs
def test_tables_15():
# TODO: theres a vertical 0.5px shift on the second page
# Regression test for colspan in last body line with footer
# https://github.com/Kozea/WeasyPrint/issues/1250
assert_pixels('colspan_last_row', 22, 36, '''

View File

@ -22,8 +22,10 @@ def get_img(html):
return body, img
@pytest.mark.xfail
@assert_no_logs
def test_images_1():
# TODO: fails because of missing SVG support
# Try a few image formats
for html in [
'<img src="%s">' % url for url in [
@ -47,8 +49,10 @@ def test_images_1():
assert img.height == 4
@pytest.mark.xfail
@assert_no_logs
def test_images_2():
# TODO: fails because of missing SVG support
# With physical units
url = "data:image/svg+xml,<svg width='2.54cm' height='0.5in'></svg>"
body, img = get_img('<img src="%s">' % url)
@ -87,8 +91,10 @@ def test_images_3():
assert text.text == 'invalid image', url
@pytest.mark.xfail
@assert_no_logs
def test_images_4():
# TODO: fails because of missing SVG support
# Format sniffing
for url in [
# GIF with JPEG mimetype
@ -278,8 +284,10 @@ def test_images_15():
assert img.content_box_y() == 10
@pytest.mark.xfail
@assert_no_logs
def test_images_16():
# TODO: fails because of missing SVG support
page, = parse('''
<body style="float: left">
<img style="height: 200px; margin: 10px; display: block" src="
@ -297,8 +305,10 @@ def test_images_16():
assert img.height == 200
@pytest.mark.xfail
@assert_no_logs
def test_images_17():
# TODO: fails because of missing SVG support
page, = parse('''
<div style="width: 300px; height: 300px">
<img src="
@ -317,8 +327,10 @@ def test_images_17():
assert img.height == 150
@pytest.mark.xfail
@assert_no_logs
def test_images_18():
# TODO: fails because of missing SVG support
# Test regression: https://github.com/Kozea/WeasyPrint/issues/1050
page, = parse('''
<img style="position: absolute" src="

View File

@ -1057,6 +1057,7 @@ def images(*widths):
for width in widths)
@pytest.mark.xfail
@assert_no_logs
@pytest.mark.parametrize('css, widths', (
('''@top-left { content: %s }
@ -1145,6 +1146,7 @@ def images(*widths):
[275, 325]), # 250 + (100 * 1 / 4), 250 + (100 * 3 / 4)
))
def test_page_style(css, widths):
# TODO: fails because of missing SVG support
expected_at_keywords = [
at_keyword for at_keyword in [
'@top-left', '@top-center', '@top-right']

View File

@ -6,6 +6,7 @@
"""
import pytest
from weasyprint import CSS, HTML
from .testing_utils import BASE_URL, assert_no_logs
@ -257,8 +258,10 @@ def test_ph_hr():
assert hr5.style['border_top_width'] == 1
@pytest.mark.xfail
@assert_no_logs
def test_ph_embedded():
# TODO: fails because of missing SVG support
document = HTML(string='''
<object data="data:image/svg+xml,<svg></svg>"
align=top hspace=10 vspace=20></object>