Commit 2788dbf9 authored by Dustin Ingram's avatar Dustin Ingram

Add failing test

parent e39cb0d2
...@@ -6,6 +6,7 @@ import re ...@@ -6,6 +6,7 @@ import re
import stat import stat
import time import time
from setuptools.build_meta import prepare_metadata_for_build_wheel
from setuptools.command.egg_info import ( from setuptools.command.egg_info import (
egg_info, manifest_maker, EggInfoDeprecationWarning, get_pkg_info_revision, egg_info, manifest_maker, EggInfoDeprecationWarning, get_pkg_info_revision,
) )
...@@ -885,7 +886,22 @@ class TestEggInfo: ...@@ -885,7 +886,22 @@ class TestEggInfo:
sources = f.read().split('\n') sources = f.read().split('\n')
assert 'setup.py' in sources assert 'setup.py' in sources
def test_egg_info_tag_only_once(self, tmpdir_cwd, env): @pytest.mark.parametrize(
('make_metadata_path', 'run_command'),
[
(
lambda env: os.path.join('.', 'foo.egg-info', 'PKG-INFO'),
lambda tmpdir_cwd, env: _run_egg_info_command(tmpdir_cwd, env)
),
(
lambda env: os.path.join(env, 'foo.dist-info', 'METADATA'),
lambda tmpdir_cwd, env: prepare_metadata_for_build_wheel(env)
)
]
)
def test_egg_info_tag_only_once(
self, tmpdir_cwd, env, make_metadata_path, run_command
):
self._create_project() self._create_project()
build_files({ build_files({
'setup.cfg': DALS(""" 'setup.cfg': DALS("""
...@@ -895,11 +911,10 @@ class TestEggInfo: ...@@ -895,11 +911,10 @@ class TestEggInfo:
tag_svn_revision = 0 tag_svn_revision = 0
"""), """),
}) })
self._run_egg_info_command(tmpdir_cwd, env) run_command(tmpdir_cwd, env)
egg_info_dir = os.path.join('.', 'foo.egg-info') with open(make_metadata_path(env)) as metadata_file:
with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file: metadata_lines = metadata_file.read().split('\n')
pkg_info_lines = pkginfo_file.read().split('\n') assert 'Version: 0.0.0.dev0' in metadata_lines
assert 'Version: 0.0.0.dev0' in pkg_info_lines
def test_get_pkg_info_revision_deprecated(self): def test_get_pkg_info_revision_deprecated(self):
pytest.warns(EggInfoDeprecationWarning, get_pkg_info_revision) pytest.warns(EggInfoDeprecationWarning, get_pkg_info_revision)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment