From 77b0ea8079597d9579d91cf04e8679ca3db71238 Mon Sep 17 00:00:00 2001 From: Nils Philippsen Date: Aug 25 2021 14:27:07 +0000 Subject: Fill in tmp_path fixture with pytest < 3.9.0 Fixes: #41 Signed-off-by: Nils Philippsen --- diff --git a/tests/conftest.py b/tests/conftest.py index 214ccbe..70f41fa 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -1,8 +1,16 @@ import os +from pathlib import Path import pytest +if [int(x) for x in pytest.__version__.split(".")] < [3, 9, 0]: + # the tmp_path fixture is only available in pytest >= 3.9.0 + @pytest.fixture + def tmp_path(tmpdir): + return Path(tmpdir) + + @pytest.fixture def tmp_path_cwd(tmp_path): """Return a temporary path and change into it"""