diff --git a/.gitignore b/.gitignore index 9cafdac8..c06cd28d 100644 --- a/.gitignore +++ b/.gitignore @@ -69,3 +69,4 @@ resource_*.py environment.yml docs_environment.yml esss_environment.yml +mxgraph/ diff --git a/tasks.py b/tasks.py index 9d97a888..443d21e7 100644 --- a/tasks.py +++ b/tasks.py @@ -137,7 +137,7 @@ def docs(ctx, python_version=None): @invoke.task def test(ctx): print_message('test'.format(), color=Fore.BLUE, bright=True) - cmd = 'pytest --cov=qmxgraph --timeout=30 -v --durations=10' + cmd = 'pytest --cov=qmxgraph --timeout=60 -v --durations=10' import subprocess diff --git a/tests/conftest.py b/tests/conftest.py index e104cd1b..31e5d7d9 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -18,10 +18,6 @@ def pytest_configure(config): if os.path.isfile(lock_file): os.remove(lock_file) - import socket - - socket.setdefaulttimeout(15.0) - # Fixtures -------------------------------------------------------------------- @@ -949,25 +945,24 @@ def _wait_graph_page_ready(host, selenium): import socket from selenium.common.exceptions import TimeoutException - timeout = 15 + timeout = 30 timeout_exceptions = (TimeoutException, TimeoutError, socket.timeout) - selenium.set_page_load_timeout(1) + selenium.set_page_load_timeout(timeout) refresh = True try: selenium.get(host.address) refresh = False except timeout_exceptions: pass - + tries = 3 if refresh: - for n in range(timeout): + for n in range(tries): try: selenium.refresh() break - except timeout_exceptions: - pass - else: - raise TimeoutException("All page load tries resulted in timeout") + except timeout_exceptions as e: + if n == tries - 1: + raise from selenium.webdriver.support.wait import WebDriverWait from selenium.webdriver.common.by import By