mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 13:11:31 +00:00
Fix FileManager unit test cases for macOS (symlinked TMPDIR)
This commit is contained in:
parent
8f7715565e
commit
0df378fb92
@ -2,7 +2,7 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
from secrets import token_urlsafe
|
from secrets import token_urlsafe
|
||||||
from os import mkdir, symlink
|
from os import mkdir, symlink
|
||||||
from os.path import join
|
from os.path import join, realpath
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from tempfile import TemporaryDirectory
|
from tempfile import TemporaryDirectory
|
||||||
|
|
||||||
@ -42,6 +42,7 @@ def generate_name():
|
|||||||
@pytest.fixture()
|
@pytest.fixture()
|
||||||
def context():
|
def context():
|
||||||
with TemporaryDirectory() as workdir:
|
with TemporaryDirectory() as workdir:
|
||||||
|
workdir = realpath(workdir) # macOS uses a symlinked TMPDIR
|
||||||
subdir = join(workdir, generate_name())
|
subdir = join(workdir, generate_name())
|
||||||
subfile = join(subdir, generate_name() + '.txt')
|
subfile = join(subdir, generate_name() + '.txt')
|
||||||
mkdir(subdir)
|
mkdir(subdir)
|
||||||
|
Loading…
Reference in New Issue
Block a user