diff --git a/changedetectionio/tests/test_auth.py b/changedetectionio/tests/test_auth.py index b84f8cf7..be817ba4 100644 --- a/changedetectionio/tests/test_auth.py +++ b/changedetectionio/tests/test_auth.py @@ -2,13 +2,12 @@ import time from flask import url_for -from . util import live_server_setup +from .util import live_server_setup, wait_for_all_checks + def test_basic_auth(client, live_server): live_server_setup(live_server) - # Give the endpoint time to spin up - time.sleep(1) # Add our URL to the import page test_url = url_for('test_basicauth_method', _external=True).replace("//","//myuser:mypass@") @@ -19,8 +18,8 @@ def test_basic_auth(client, live_server): follow_redirects=True ) assert b"1 Imported" in res.data + wait_for_all_checks(client) time.sleep(1) - # Check form validation res = client.post( url_for("edit_page", uuid="first"), @@ -29,7 +28,7 @@ def test_basic_auth(client, live_server): ) assert b"Updated watch." in res.data - time.sleep(1) + wait_for_all_checks(client) res = client.get( url_for("preview_page", uuid="first"), follow_redirects=True diff --git a/changedetectionio/tests/test_automatic_follow_ldjson_price.py b/changedetectionio/tests/test_automatic_follow_ldjson_price.py index f0c0d104..c589ea25 100644 --- a/changedetectionio/tests/test_automatic_follow_ldjson_price.py +++ b/changedetectionio/tests/test_automatic_follow_ldjson_price.py @@ -100,7 +100,7 @@ def test_check_ldjson_price_autodetect(client, live_server): # Accept it uuid = extract_UUID_from_client(client) - + time.sleep(1) client.get(url_for('price_data_follower.accept', uuid=uuid, follow_redirects=True)) wait_for_all_checks(client) diff --git a/changedetectionio/tests/test_backend.py b/changedetectionio/tests/test_backend.py index 2d21067e..1e1c6496 100644 --- a/changedetectionio/tests/test_backend.py +++ b/changedetectionio/tests/test_backend.py @@ -62,9 +62,6 @@ def test_check_basic_change_detection_functionality(client, live_server): # Make a change set_modified_response() - res = urlopen(url_for('test_endpoint', _external=True)) - assert b'which has this one new line' in res.read() - # Force recheck res = client.get(url_for("form_watch_checknow"), follow_redirects=True) assert b'1 watches queued for rechecking.' in res.data diff --git a/changedetectionio/tests/test_encoding.py b/changedetectionio/tests/test_encoding.py index 4b273edf..c00a28b8 100644 --- a/changedetectionio/tests/test_encoding.py +++ b/changedetectionio/tests/test_encoding.py @@ -3,7 +3,7 @@ import time from flask import url_for -from .util import live_server_setup +from .util import live_server_setup, wait_for_all_checks import pytest @@ -27,9 +27,6 @@ def set_html_response(): def test_check_encoding_detection(client, live_server): set_html_response() - # Give the endpoint time to spin up - time.sleep(1) - # Add our URL to the import page test_url = url_for('test_endpoint', content_type="text/html", _external=True) client.post( @@ -39,7 +36,7 @@ def test_check_encoding_detection(client, live_server): ) # Give the thread time to pick it up - time.sleep(2) + wait_for_all_checks(client) res = client.get( url_for("preview_page", uuid="first"), @@ -56,9 +53,6 @@ def test_check_encoding_detection(client, live_server): def test_check_encoding_detection_missing_content_type_header(client, live_server): set_html_response() - # Give the endpoint time to spin up - time.sleep(1) - # Add our URL to the import page test_url = url_for('test_endpoint', _external=True) client.post( @@ -67,8 +61,7 @@ def test_check_encoding_detection_missing_content_type_header(client, live_serve follow_redirects=True ) - # Give the thread time to pick it up - time.sleep(2) + wait_for_all_checks(client) res = client.get( url_for("preview_page", uuid="first"), diff --git a/changedetectionio/tests/test_extract_csv.py b/changedetectionio/tests/test_extract_csv.py index 52596a9e..7fcc83c4 100644 --- a/changedetectionio/tests/test_extract_csv.py +++ b/changedetectionio/tests/test_extract_csv.py @@ -29,6 +29,7 @@ def test_check_extract_text_from_diff(client, live_server): # Load in 5 different numbers/changes last_date="" for n in range(5): + time.sleep(1) # Give the thread time to pick it up print("Bumping snapshot and checking.. ", n) last_date = str(time.time()) diff --git a/changedetectionio/tests/test_rss.py b/changedetectionio/tests/test_rss.py index 7f030482..8fe2e84d 100644 --- a/changedetectionio/tests/test_rss.py +++ b/changedetectionio/tests/test_rss.py @@ -69,6 +69,7 @@ def test_rss_and_token(client, live_server): wait_for_all_checks(client) set_modified_response() + time.sleep(1) client.get(url_for("form_watch_checknow"), follow_redirects=True) wait_for_all_checks(client) @@ -87,7 +88,7 @@ def test_rss_and_token(client, live_server): assert b"Access denied, bad token" not in res.data assert b"Random content" in res.data - res = client.get(url_for("form_delete", uuid="all"), follow_redirects=True) + client.get(url_for("form_delete", uuid="all"), follow_redirects=True) def test_basic_cdata_rss_markup(client, live_server): #live_server_setup(live_server) diff --git a/requirements.txt b/requirements.txt index a13bc8d0..6922ad53 100644 --- a/requirements.txt +++ b/requirements.txt @@ -29,7 +29,7 @@ chardet>2.3.0 wtforms~=3.0 jsonpath-ng~=1.5.3 -dnspython==2.6.1 +dnspython==2.6.1 # related to eventlet fixes # jq not available on Windows so must be installed manually