From 2c27f1070aadaa5e2840dae1fbe316fe7393ec0d Mon Sep 17 00:00:00 2001 From: yoldas Date: Mon, 11 Mar 2024 19:21:31 +0000 Subject: [PATCH] Checking incorrect patching: find_dart_source_samples_rows uses imported lighthouse.helpers.create_dart_connection; not the origial lighthouse.db.dart.create_dart_connection. Patching the original is not correct and has no effect in this test --- tests/helpers/test_dart.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/helpers/test_dart.py b/tests/helpers/test_dart.py index 6a46e8c6..2abfaf7c 100644 --- a/tests/helpers/test_dart.py +++ b/tests/helpers/test_dart.py @@ -23,8 +23,8 @@ def test_find_dart_source_samples_rows_not_found_barcode(app, dart_samples): def test_exceptions_are_propagated_up(app, dart_samples): with app.app_context(): - with patch("lighthouse.db.dart.create_dart_connection", side_effect=Exception()): - found = find_dart_source_samples_rows("unknown") + with patch("lighthouse.helpers.dart.create_dart_connection", side_effect=Exception()): + found = find_dart_source_samples_rows("unknown") # XXX: Raise exception here with raises(Exception): found = find_dart_source_samples_rows("unknown") assert found is None