Improve testing for images in html

This is for pytest-dev/pytest-selenium#237.

My original change was redundant with pytest-dev/pytest-html#277, so just
update tests and acknowledgements for the author of #277, the author of #287,
and the reporters of #265 and pytest-dev/pytest-selenium#237.
This commit is contained in:
Dan Halperin 2020-05-12 16:43:57 -07:00
parent 484c0cec8d
commit 9e06ccb376
2 changed files with 8 additions and 0 deletions

View File

@ -1,6 +1,12 @@
Release Notes
-------------
**2.1.2 (unreleased)**
* Fix issue with missing image or video in extras. (`#265 <https://github.com/pytest-dev/pytest-html/issues/265>`_ and `pytest-selenium#237 <https://github.com/pytest-dev/pytest-selenium/issues/237>`_)
* Thanks to `@p00j4 <https://github.com/p00j4>`_ and `@anothermattbrown <https://github.com/anothermattbrown>`_ for reporting and `@christiansandberg <https://github.com/christiansandberg>`_ and `@superdodd <https://github.com/superdodd>`_ and `@dhalperi <https://github.com/dhalperi>`_ for the fix
**2.1.1 (2020-03-18)**
* Fix issue with funcargs causing failures. (`#282 <https://github.com/pytest-dev/pytest-html/issues/282>`_)

View File

@ -591,8 +591,10 @@ class TestHTML:
file_name = f"test_very_long_test_name.py__{test_name}_0_0.png"[-255:]
src = "assets/" + file_name
link = f'<a class="image" href="{src}" target="_blank">'
img = f'<img src="{src}"/>'
assert result.ret
assert link in html
assert img in html
assert os.path.exists(src)
def test_extra_fixture(self, testdir):