From 2075bcdae1a18c68c163197fbe0d9aa9887df2a0 Mon Sep 17 00:00:00 2001 From: Hagen Wierstorf Date: Mon, 1 Jul 2024 10:28:23 +0200 Subject: [PATCH] Fix error --- tests/test_io.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test_io.py b/tests/test_io.py index 69352a1..e2033cf 100644 --- a/tests/test_io.py +++ b/tests/test_io.py @@ -1,6 +1,7 @@ import os import platform import stat +import sys import time import pytest @@ -1521,8 +1522,12 @@ def test_rmdir(tmpdir): path = audeer.mkdir(tmpdir, "folder") link = os.path.join(tmpdir, "link") os.symlink(path, link) - with pytest.raises(OSError, match="symbolic link"): - # Skip this on MacOS Python 3.12? + # Error message changed at some point for Python 3.12 + if sys.version_info >= "3.12.1": + error_msg = "None" + else: + error_msg = "symbolic link" + with pytest.raises(OSError, match=error_msg): audeer.rmdir(link, follow_symlink=False) assert os.path.exists(link) assert os.path.exists(path)