Skip to content

Commit

Permalink
Fix error
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Jul 1, 2024
1 parent 8856191 commit 2075bcd
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test_io.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import platform
import stat
import sys
import time

import pytest
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 2075bcd

Please sign in to comment.