mirror of
https://github.com/dgtlmoon/changedetection.io.git
synced 2025-12-17 05:26:30 +00:00
Run all pytests in parallel (#3569)
This commit is contained in:
@@ -4,10 +4,10 @@ from flask import url_for
|
||||
from .util import set_original_response, set_modified_response, live_server_setup, wait_for_all_checks
|
||||
import logging
|
||||
|
||||
def test_check_notification_error_handling(client, live_server, measure_memory_usage):
|
||||
def test_check_notification_error_handling(client, live_server, measure_memory_usage, datastore_path):
|
||||
|
||||
# live_server_setup(live_server) # Setup on conftest per function
|
||||
set_original_response()
|
||||
set_original_response(datastore_path=datastore_path)
|
||||
|
||||
# Set a URL and fetch it, then set a notification URL which is going to give errors
|
||||
test_url = url_for('test_endpoint', _external=True)
|
||||
@@ -19,7 +19,7 @@ def test_check_notification_error_handling(client, live_server, measure_memory_u
|
||||
assert b"Watch added" in res.data
|
||||
|
||||
wait_for_all_checks(client)
|
||||
set_modified_response()
|
||||
set_modified_response(datastore_path=datastore_path)
|
||||
|
||||
working_notification_url = url_for('test_notification_endpoint', _external=True).replace('http', 'json')
|
||||
broken_notification_url = "jsons://broken-url-xxxxxxxx123/test"
|
||||
@@ -73,9 +73,9 @@ def test_check_notification_error_handling(client, live_server, measure_memory_u
|
||||
assert found_name_resolution_error
|
||||
|
||||
# And the working one, which is after the 'broken' one should still have fired
|
||||
with open("test-datastore/notification.txt", "r") as f:
|
||||
with open(os.path.join(datastore_path, "notification.txt"), "r") as f:
|
||||
notification_submission = f.read()
|
||||
os.unlink("test-datastore/notification.txt")
|
||||
os.unlink(os.path.join(datastore_path, "notification.txt"))
|
||||
assert 'xxxxx' in notification_submission
|
||||
|
||||
client.get(url_for("ui.form_delete", uuid="all"), follow_redirects=True)
|
||||
|
||||
Reference in New Issue
Block a user