approach used to introduce media types to the project. Images and videos now use a method called
_make_media_html_div which generates the media div in a streamlined manner. Both _append_image and _append_video
use this method, to which they can pass their base string and class.
Unit tests were left untouched, as the changes only affect private methods.
Code for the video extra has been extracted to a function to clean up a bit the if/elif/elif that is starting to
get pretty big. Maybe the other conditions could be extracted to their own method to clean up a bit. Once again,
there seems to be a lot of code duplication with image, so we may want to refactor images, videos, and audio as
a media type and have some kind of template method.
Basic unit tests were added to make sure that the extra was correctly added to the report when the extra was
requested.
Support uses the raw html section in order to pass a video tag which is compatible with html5.
Video size and style should be handled by the "video" class in the css file.
* Close opened resource.
* Update pytest_html/plugin.py
Co-Authored-By: Bruno Rocha <rochacbruno@users.noreply.github.com>
* Use `f""` instead of `.format()` call.
* Add validation for raised warnings to tests.
Support Chinese display
[before]:
TestForSyncProduct::test_1_valueValid[test Case Name-add]
TestForSyncProduct::test_2_valueValid[\u6d4b\u8bd5\u7528\u4f8b\u540d\u79f0-update]
[now]:
TestForSyncProduct::test_1_valueValid[test Case Name-add]
TestForSyncProduct::test_2_valueValid[测试用例名称-update]
* Drop support for legacy Python 2.7
* Upgrade Python syntax with pyupgrade --py36-plus
* Require pytest 5+, supports only Python 3
* Format with Black
The content in log sections doesn't always include a trailing newline, so this includes one afterwards ensuring that the next section header is placed on a new line. If there's already a trailing newline, this has no effect as it uses `<br>`.
By default terminals would open files in editors and URLs in browsers.
By printing the generated html report using an URL (file://) we enable
users to click the terminal to open it. Previously this opened the file
in the text editor which is very unlikely to be what user would want.
When the --html flag is used in pytest.ini with "addopts" and the
report title is stored in an environment variable, the name of the
environment variable was used as the report title.
In other words, the environment variable was never expanded.
Fixes: #201
* added assets name hashing option
* from command line option to config option
* new naming strategy
* fix
* Flake8 issues fixed
* more Flake8 issues fixed