From 3c5d98f9e882581f5f5767a056e01fe28d7369d9 Mon Sep 17 00:00:00 2001 From: Arun Babu Neelicattu Date: Sat, 4 Jul 2020 15:49:19 +0200 Subject: [PATCH] inspection: fix pytest pathlib compat (Python 3.5) --- tests/inspection/test_info.py | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/tests/inspection/test_info.py b/tests/inspection/test_info.py index adab28783aa..748334a4f3d 100644 --- a/tests/inspection/test_info.py +++ b/tests/inspection/test_info.py @@ -28,8 +28,13 @@ def demo_wheel(): # type: () -> Path @pytest.fixture -def demo_setup(tmp_path): # type: (Path) -> Path - setup_py = tmp_path / "setup.py" +def source_dir(tmp_path): # type: (Path) -> Path + yield Path(tmp_path.as_posix()) + + +@pytest.fixture +def demo_setup(source_dir): # type: (Path) -> Path + setup_py = source_dir / "setup.py" setup_py.write_text( decode( "from setuptools import setup; " @@ -38,12 +43,12 @@ def demo_setup(tmp_path): # type: (Path) -> Path 'install_requires=["package"])' ) ) - yield tmp_path + yield source_dir @pytest.fixture -def demo_setup_cfg(tmp_path): # type: (Path) -> Path - setup_cfg = tmp_path / "setup.cfg" +def demo_setup_cfg(source_dir): # type: (Path) -> Path + setup_cfg = source_dir / "setup.cfg" setup_cfg.write_text( decode( "\n".join( @@ -57,12 +62,12 @@ def demo_setup_cfg(tmp_path): # type: (Path) -> Path ) ) ) - yield tmp_path + yield source_dir @pytest.fixture -def demo_setup_complex(tmp_path): # type: (Path) -> Path - setup_py = tmp_path / "setup.py" +def demo_setup_complex(source_dir): # type: (Path) -> Path + setup_py = source_dir / "setup.py" setup_py.write_text( decode( "from setuptools import setup; " @@ -71,7 +76,7 @@ def demo_setup_complex(tmp_path): # type: (Path) -> Path 'install_requires=[i for i in ["package"]])' ) ) - yield tmp_path + yield source_dir @pytest.fixture