From 7a24d8d10e19f9f3deb52b7b15155ec0105177f1 Mon Sep 17 00:00:00 2001 From: Andy Shapiro Date: Wed, 10 Jul 2024 00:22:09 -0400 Subject: [PATCH] finicky test --- tests/desktop/components/test_database_form.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tests/desktop/components/test_database_form.py b/tests/desktop/components/test_database_form.py index 351b8ed4..c35203fe 100644 --- a/tests/desktop/components/test_database_form.py +++ b/tests/desktop/components/test_database_form.py @@ -1,3 +1,4 @@ +import sys import tempfile from pathlib import Path @@ -8,9 +9,16 @@ def test_additional_path_checks(): # cannot write to this path - p = Path("/root/test.txt") - with pytest.raises(ValueError, match="Cannot create path"): - database_form.additional_path_checks(p) + + match = None + if sys.platform == "darwin": + match = "Cannot create path" + elif sys.platform == "linux": + match = "Permission denied" + if match: + p = Path("/root/test.txt") + with pytest.raises(ValueError, match=match): + database_form.additional_path_checks(p) # non sqlite file with tempfile.NamedTemporaryFile(mode="w") as f: