Skip to content

chore: remove py dependency #314

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ services:
webserver:
container_name: webserver
build:
context: docker
context: .
environment:
- PYTHONDONTWRITEBYTECODE=1
networks:
Expand Down
9 changes: 9 additions & 0 deletions docs/news.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Release Notes
=============

4.0.2 (2023-09-13)
------------------

* Remove py dependency

* Thanks to `@treiher <https://github.com/treiher>`_ for reporting the issue.

* Thanks to `@sandre35 <https://github.com/sandre35>`_ for the PR.

4.0.1 (2023-05-28)
------------------

Expand Down
18 changes: 7 additions & 11 deletions src/pytest_selenium/drivers/crossbrowsertesting.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.

from py.xml import html
import html
import pytest

from pytest_selenium.drivers.cloud import Provider
Expand Down Expand Up @@ -113,13 +113,9 @@ def driver_kwargs(request, test, capabilities, **kwargs):


def _video_html(video):
html.__tagspec__.update(dict([(x, 1) for x in ("video", "source")]))
video_attrs = {
"controls": "",
"poster": video.get("image"),
"play-pause-on-click": "",
"style": "border:1px solid #e6e6e6; float:right; height:240px; "
"margin-left:5px; overflow:hidden; width:320px",
}
source_attrs = {"src": video.get("video"), "type": "video/mp4"}
return str(html.video(html.source(**source_attrs), **video_attrs))
return (
f'<video controls="" play-pause-on-click="" poster="{html.escape(video.get("image"))}"'
'style="border:1px solid #e6e6e6; float:right; height:240px; margin-left:5px; overflow:hidden; width:320px">'
f'<source src="{html.escape(video.get("video"))}" type="video/mp4"></source>'
"</video>"
)
33 changes: 12 additions & 21 deletions src/pytest_selenium/drivers/saucelabs.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import os
import json

from py.xml import html
import pytest

from pytest_selenium.drivers.cloud import Provider
Expand Down Expand Up @@ -151,26 +150,18 @@ def _video_html(session):
session=session
)

return str(
html.div(
html.object(
html.param(value="true", name="allowfullscreen"),
html.param(value="always", name="allowscriptaccess"),
html.param(value="high", name="quality"),
html.param(value="#000000", name="bgcolor"),
html.param(value=flash_vars.replace(" ", ""), name="flashvars"),
width="100%",
height="100%",
type="application/x-shockwave-flash",
data="https://cdn1.saucelabs.com/sauce_skin_deprecated/lib/"
"flowplayer/flowplayer-3.2.17.swf",
name="player_api",
id="player_api",
),
id="player{session}".format(session=session),
style="border:1px solid #e6e6e6; float:right; height:240px;"
"margin-left:5px; overflow:hidden; width:320px",
)
return (
f'<div id="player{session}" style="border:1px solid #e6e6e6; float:right; height:240px; margin-left:5px;'
'overflow:hidden; width:320px">'
'<object data="https://cdn1.saucelabs.com/sauce_skin_deprecated/lib/flowplayer/flowplayer-3.2.17.swf"'
'height="100%" id="player_api" name="player_api" type="application/x-shockwave-flash" width="100%">'
'<param name="allowfullscreen" value="true"/>'
'<param name="allowscriptaccess" value="always"/>'
'<param name="quality" value="high"/>'
'<param name="bgcolor" value="#000000"/>'
f'<param name="flashvars" value="{flash_vars.replace(" ", "")}"/>'
"</object>"
"</div>"
)


Expand Down
20 changes: 7 additions & 13 deletions src/pytest_selenium/drivers/testingbot.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
from hashlib import md5

import pytest
from py.xml import html

from pytest_selenium.drivers.cloud import Provider

Expand Down Expand Up @@ -107,18 +106,13 @@ def driver_kwargs(request, test, capabilities, host, port, **kwargs):


def _video_html(video_url, session):
return str(
html.div(
html.video(
html.source(src=video_url, type="video/mp4"),
width="100%",
height="100%",
controls="controls",
),
id="mediaplayer{session}".format(session=session),
style="border:1px solid #e6e6e6; float:right; height:240px;"
"margin-left:5px; overflow:hidden; width:320px",
)
return (
f'<div id="mediaplayer{session}" style="border:1px solid #e6e6e6; float:right;'
'height:240px; margin-left:5px; overflow:hidden; width:320px">'
'<video controls="controls" height="100%" width="100%">'
f'<source src="{video_url}" type="video/mp4"></source>'
"</video>"
"</div>"
)


Expand Down