Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pyodide
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
pyodide
Commits
df212318
Commit
df212318
authored
Oct 04, 2018
by
Roman Yurchak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Monkeypatch selenium with a fix against ConnectionError
parent
222457c2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletion
+32
-1
benchmark/benchmark.py
benchmark/benchmark.py
+1
-1
pyodide_build/_fixes.py
pyodide_build/_fixes.py
+22
-0
test/conftest.py
test/conftest.py
+9
-0
No files found.
benchmark/benchmark.py
View file @
df212318
...
...
@@ -7,7 +7,7 @@ import sys
sys
.
path
.
insert
(
0
,
str
((
Path
(
__file__
).
resolve
().
parents
[
1
]
/
'test'
)))
import
conftest
# noqa
import
conftest
# noqa
: E402
SKIP
=
set
([
'fft'
,
'hyantes'
,
'README'
])
...
...
pyodide_build/_fixes.py
0 → 100644
View file @
df212318
import
socket
# Temporary fix from https://github.com/SeleniumHQ/selenium/pull/6480
# to avoid ConnectionError in selenium
def
_selenium_is_connectable
(
port
,
host
=
"localhost"
):
"""
Tries to connect to the server at port to see if it is running.
:Args:
- port - The port to connect.
"""
socket_
=
None
try
:
socket_
=
socket
.
create_connection
((
host
,
port
),
1
)
result
=
True
except
(
socket
.
error
,
ConnectionError
):
result
=
False
finally
:
if
socket_
:
socket_
.
close
()
return
result
test/conftest.py
View file @
df212318
...
...
@@ -16,6 +16,15 @@ import shutil
TEST_PATH
=
pathlib
.
Path
(
__file__
).
parents
[
0
].
resolve
()
BUILD_PATH
=
TEST_PATH
/
'..'
/
'build'
sys
.
path
.
append
(
TEST_PATH
/
'..'
)
from
pyodide_build._fixes
import
_selenium_is_connectable
# noqa: E402
import
selenium.webdriver.common.utils
# noqa: E402
# XXX: Temporary fix for ConnectionError in selenium
selenium
.
webdriver
.
common
.
utils
.
is_connectable
=
_selenium_is_connectable
try
:
import
pytest
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment