diff --git a/changedetectionio/tests/test_group.py b/changedetectionio/tests/test_group.py index e02a7e8d3..abbe2b966 100644 --- a/changedetectionio/tests/test_group.py +++ b/changedetectionio/tests/test_group.py @@ -166,7 +166,8 @@ def test_tag_add_in_ui(client, live_server, measure_memory_usage, datastore_path delete_all_watches(client) def test_group_tag_notification(client, live_server, measure_memory_usage, datastore_path): - + delete_all_watches(client) + set_original_response(datastore_path=datastore_path) test_url = url_for('test_endpoint', _external=True) diff --git a/changedetectionio/tests/test_jsonpath_jq_selector.py b/changedetectionio/tests/test_jsonpath_jq_selector.py index d598ecc6c..703ab042c 100644 --- a/changedetectionio/tests/test_jsonpath_jq_selector.py +++ b/changedetectionio/tests/test_jsonpath_jq_selector.py @@ -224,6 +224,7 @@ def check_json_filter(json_filter, client, live_server, datastore_path): set_original_response(datastore_path=datastore_path) + delete_all_watches(client) # Add our URL to the import page test_url = url_for('test_endpoint', content_type="application/json", _external=True) uuid = client.application.config.get('DATASTORE').add_watch(url=test_url, extras={"include_filters": json_filter.splitlines()}) diff --git a/changedetectionio/tests/util.py b/changedetectionio/tests/util.py index 440beef3b..3b48c48a9 100644 --- a/changedetectionio/tests/util.py +++ b/changedetectionio/tests/util.py @@ -135,7 +135,14 @@ def delete_all_watches(client=None): uuids = list(client.application.config.get('DATASTORE').data['watching']) for uuid in uuids: client.application.config.get('DATASTORE').delete(uuid) + from changedetectionio.flask_app import update_q + # Clear the queue to prevent leakage to next test + while not update_q.empty(): + try: + update_q.get_nowait() + except: + break def wait_for_all_checks(client=None): """