Fix FileManager unit test cases for macOS (symlinked TMPDIR)

This commit is contained in:
Kristóf Tóth 2019-08-14 13:49:58 +02:00
parent 8f7715565e
commit 0df378fb92
1 changed files with 2 additions and 1 deletions

View File

@ -2,7 +2,7 @@
from dataclasses import dataclass
from secrets import token_urlsafe
from os import mkdir, symlink
from os.path import join
from os.path import join, realpath
from pathlib import Path
from tempfile import TemporaryDirectory
@ -42,6 +42,7 @@ def generate_name():
@pytest.fixture()
def context():
with TemporaryDirectory() as workdir:
workdir = realpath(workdir) # macOS uses a symlinked TMPDIR
subdir = join(workdir, generate_name())
subfile = join(subdir, generate_name() + '.txt')
mkdir(subdir)