File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change 5
5
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
6
7
7
import re
8
+ from distutils .version import LooseVersion
8
9
9
10
import pytest
11
+ from pytest_html import __version__ as PYTEST_HTML_VERSION
10
12
11
13
pytestmark = pytest .mark .nondestructive
12
14
13
15
URL_LINK = '<a class="url" href="{0}/" target="_blank">URL</a>'
14
- SCREENSHOT_LINK_REGEX = (
15
- '<a class="image" href=".*" target="_blank">Screenshot</a>'
16
- ) # noqa
17
- SCREENSHOT_REGEX = '<div class="image"><a href=".*"><img src=".*"/></a></div>'
16
+
17
+ if LooseVersion (PYTEST_HTML_VERSION ) < LooseVersion ("2.0.0" ):
18
+ SCREENSHOT_LINK_REGEX = '<a class="image" href=".*" target="_blank">Screenshot</a>'
19
+ SCREENSHOT_REGEX = '<div class="image"><a href=".*"><img src=".*"/></a></div>'
20
+ else :
21
+ SCREENSHOT_LINK_REGEX = '<a class="image" href=".*" target="_blank"></a>'
22
+ SCREENSHOT_REGEX = (
23
+ '<div class="image"><a class="image" href=".*" target="_blank"></a></div>'
24
+ )
25
+
18
26
LOGS_REGEX = '<a class="text" href=".*" target="_blank">.* Log</a>'
19
27
HTML_REGEX = '<a class="text" href=".*" target="_blank">HTML</a>'
20
28
You can’t perform that action at this time.
0 commit comments