Merge branch 'master' into master
This commit is contained in:
commit
3d5e3340aa
|
@ -68,7 +68,8 @@ def pytest_configure(config):
|
|||
htmlpath = config.getoption("htmlpath")
|
||||
if htmlpath:
|
||||
for csspath in config.getoption("css"):
|
||||
open(csspath)
|
||||
if not os.path.exists(csspath):
|
||||
raise IOError(f"No such file or directory: '{csspath}'")
|
||||
if not hasattr(config, "slaveinput"):
|
||||
# prevent opening htmlpath on slave nodes (xdist)
|
||||
config._html = HTMLReport(htmlpath, config)
|
||||
|
|
|
@ -111,7 +111,7 @@ function init () {
|
|||
|
||||
show_filters();
|
||||
|
||||
toggle_sort_states(find('.initial-sort'));
|
||||
sort_column(find('.initial-sort'));
|
||||
|
||||
find_all('.sortable').forEach(function(elem) {
|
||||
elem.addEventListener("click",
|
||||
|
|
|
@ -759,7 +759,7 @@ class TestHTML:
|
|||
assert re.search(regex_error, html) is not None
|
||||
|
||||
@pytest.mark.parametrize("colors", [(["red"]), (["green", "blue"])])
|
||||
def test_css(self, testdir, colors):
|
||||
def test_css(self, testdir, recwarn, colors):
|
||||
testdir.makepyfile("def test_pass(): pass")
|
||||
css = {}
|
||||
cssargs = []
|
||||
|
@ -770,14 +770,16 @@ class TestHTML:
|
|||
cssargs.extend(["--css", path])
|
||||
result, html = run(testdir, "report.html", "--self-contained-html", *cssargs)
|
||||
assert result.ret == 0
|
||||
assert len(recwarn) == 0
|
||||
for k, v in css.items():
|
||||
assert str(v["path"]) in html
|
||||
assert v["style"] in html
|
||||
|
||||
def test_css_invalid(self, testdir):
|
||||
def test_css_invalid(self, testdir, recwarn):
|
||||
testdir.makepyfile("def test_pass(): pass")
|
||||
result = testdir.runpytest("--html", "report.html", "--css", "style.css")
|
||||
assert result.ret
|
||||
assert len(recwarn) == 0
|
||||
assert "No such file or directory: 'style.css'" in result.stderr.str()
|
||||
|
||||
def test_css_invalid_no_html(self, testdir):
|
||||
|
|
Loading…
Reference in New Issue