def test_check_package(tmp_path): setup_py = tmp_path / "setup.py" setup_py.write_text(textwrap.dedent("""\ from setuptools import setup setup( name='foo', ) """)) assert cpv.check_package(tmp_path) is True
def test_check_not_a_package(tmp_path, capsys): assert not cpv.check_package(tmp_path) assert capsys.readouterr().out == 'no setup.py -- not a Python package?\n'
def test_check_not_a_directory(tmp_path, capsys): assert not cpv.check_package(tmp_path / "xyzzy") assert capsys.readouterr().out == 'not a directory\n'