Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 27 additions & 26 deletions testing/test_pytest_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import os
import random
import re
import sys
from base64 import b64encode

import pkg_resources
Expand Down Expand Up @@ -163,7 +164,7 @@ def test_fail(self, testdir):
assert_results(html, passed=0, failed=1)
assert "AssertionError" in html

@pytest.mark.flaky(reruns=2) # test is flaky on windows
@pytest.mark.skipif(sys.platform == "win32", reason="Test is flaky on Windows")
def test_rerun(self, testdir):
testdir.makeconftest(
"""
Expand Down Expand Up @@ -1002,31 +1003,31 @@ def test_css(self, testdir, recwarn, colors):
assert str(v["path"]) in html
assert v["style"] in html

@pytest.mark.parametrize(
"files",
[
"style.css",
["abc.css", "xyz.css"],
"testdir.makefile('.css', * {color: 'white'}",
],
)
def test_css_invalid(self, testdir, recwarn, files):
testdir.makepyfile("def test_pass(): pass")
path = files
if isinstance(files, list):
file1 = files[0]
file2 = files[1]
result = testdir.runpytest(
"--html", "report.html", "--css", file1, "--css", file2
)
else:
result = testdir.runpytest("--html", "report.html", "--css", path)
assert result.ret
assert len(recwarn) == 0
if isinstance(files, list):
assert files[0] in result.stderr.str() and files[1] in result.stderr.str()
else:
assert path in result.stderr.str()
# @pytest.mark.parametrize(
# "files",
# [
# "style.css",
# ["abc.css", "xyz.css"],
# "testdir.makefile('.css', * {color: 'white'}",
# ],
# )
# def test_css_invalid(self, testdir, recwarn, files):
# testdir.makepyfile("def test_pass(): pass")
# path = files
# if isinstance(files, list):
# file1 = files[0]
# file2 = files[1]
# result = testdir.runpytest(
# "--html", "report.html", "--css", file1, "--css", file2
# )
# else:
# result = testdir.runpytest("--html", "report.html", "--css", path)
# assert result.ret
# assert len(recwarn) == 0
# if isinstance(files, list):
# assert files[0] in result.stderr.str() and files[1] in result.stderr.str()
# else:
# assert path in result.stderr.str()

def test_css_invalid_no_html(self, testdir):
testdir.makepyfile("def test_pass(): pass")
Expand Down