From 429d528d645ac1d51454400535c799564de936f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Behmo?= Date: Tue, 29 Nov 2022 16:02:17 +0100 Subject: [PATCH] fix: unit test on github's macOs action runner Somehow, the tmp directory is a symlink on github. --- tests/commands/test_local.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/commands/test_local.py b/tests/commands/test_local.py index abb8443..3231835 100644 --- a/tests/commands/test_local.py +++ b/tests/commands/test_local.py @@ -1,4 +1,5 @@ import os +import pathlib import tempfile import unittest from unittest.mock import patch @@ -27,6 +28,8 @@ class LocalTests(unittest.TestCase, TestCommandMixin): def test_copyfrom(self) -> None: with temporary_root() as root: with tempfile.TemporaryDirectory() as directory: + # resolve actual path, just like click.Path does it. + directory = os.fsdecode(pathlib.Path(directory).resolve()) with patch("tutor.utils.docker_compose") as mock_docker_compose: self.invoke_in_root(root, ["config", "save"])