Commit defc24c4 authored by Roman Yurchak's avatar Roman Yurchak

Lint

parent 79ba41b4
...@@ -68,7 +68,7 @@ def parse_numpy_benchmark(filename): ...@@ -68,7 +68,7 @@ def parse_numpy_benchmark(filename):
lines = [] lines = []
with open(filename) as fp: with open(filename) as fp:
for line in fp: for line in fp:
m = re.match('^#\s*(setup|run): (.*)$', line) m = re.match(r'^#\s*(setup|run): (.*)$', line)
if m: if m:
line = '{} = {!r}\n'.format(m.group(1), m.group(2)) line = '{} = {!r}\n'.format(m.group(1), m.group(2))
lines.append(line) lines.append(line)
......
...@@ -84,7 +84,7 @@ class SeleniumWrapper: ...@@ -84,7 +84,7 @@ class SeleniumWrapper:
driver.get(f'http://{server_hostname}:{server_port}/test.html') driver.get(f'http://{server_hostname}:{server_port}/test.html')
try: try:
wait.until(PyodideInited()) wait.until(PyodideInited())
except TimeoutException as exc: except TimeoutException:
_display_driver_logs(self.browser, driver) _display_driver_logs(self.browser, driver)
raise TimeoutException() raise TimeoutException()
self.wait = wait self.wait = wait
...@@ -126,7 +126,7 @@ class SeleniumWrapper: ...@@ -126,7 +126,7 @@ class SeleniumWrapper:
) )
try: try:
self.wait.until(PackageLoaded()) self.wait.until(PackageLoaded())
except TimeoutException as exc: except TimeoutException:
_display_driver_logs(self.browser, self.driver) _display_driver_logs(self.browser, self.driver)
print(self.logs) print(self.logs)
raise TimeoutException('runPythonAsync timed out') raise TimeoutException('runPythonAsync timed out')
...@@ -163,7 +163,7 @@ class SeleniumWrapper: ...@@ -163,7 +163,7 @@ class SeleniumWrapper:
__tracebackhide__ = True __tracebackhide__ = True
try: try:
self.wait.until(PackageLoaded()) self.wait.until(PackageLoaded())
except TimeoutException as exc: except TimeoutException:
_display_driver_logs(self.browser, self.driver) _display_driver_logs(self.browser, self.driver)
print(self.logs) print(self.logs)
raise TimeoutException('wait_until_packages_loaded timed out') raise TimeoutException('wait_until_packages_loaded timed out')
......
...@@ -71,7 +71,7 @@ def test_pythonexc2js(selenium): ...@@ -71,7 +71,7 @@ def test_pythonexc2js(selenium):
try: try:
selenium.run_js('return pyodide.runPython("5 / 0")') selenium.run_js('return pyodide.runPython("5 / 0")')
except selenium.JavascriptException as e: except selenium.JavascriptException as e:
assert('ZeroDivisionError' in str(e)) assert 'ZeroDivisionError' in str(e)
else: else:
assert False, 'Expected exception' assert False, 'Expected exception'
...@@ -393,7 +393,7 @@ def test_cpython_core(python_test, selenium, request): ...@@ -393,7 +393,7 @@ def test_cpython_core(python_test, selenium, request):
if e.code != 0: if e.code != 0:
raise RuntimeError(f'Failed with code: {{e.code}}') raise RuntimeError(f'Failed with code: {{e.code}}')
""".format(name)) """.format(name))
except selenium.JavascriptException as e: except selenium.JavascriptException:
print(selenium.logs) print(selenium.logs)
raise raise
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment