Skip to content

Commit

Permalink
inspection: fix pytest pathlib compat (Python 3.5)
Browse files Browse the repository at this point in the history
  • Loading branch information
abn committed Jul 4, 2020
1 parent 6ecaf28 commit 3c5d98f
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions tests/inspection/test_info.py
Expand Up @@ -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; "
Expand All @@ -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(
Expand All @@ -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; "
Expand All @@ -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
Expand Down

0 comments on commit 3c5d98f

Please sign in to comment.