diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-25 10:28:25 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-12-25 10:28:25 -0500 |
| commit | f4ad85091ab6a78134de046ef5c7a57cffa273ac (patch) | |
| tree | 7f2794d4b8140366cfef4b5abe7e3f55dee85225 | |
| parent | 41eb0370e323d67715aebb1404890709c50cd018 (diff) | |
| download | python-setuptools-git-f4ad85091ab6a78134de046ef5c7a57cffa273ac.tar.gz | |
Wrap the result in a DirList to avoid tuple unpacking and unused variables
| -rw-r--r-- | setuptools/tests/test_egg_info.py | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 74beb7f5..333d11d6 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -60,7 +60,7 @@ class TestEggInfo(object): self._create_project() self._run_install_command(tmpdir_cwd, env) - _, actual = self._find_egg_info_files(env.paths['lib']) + actual = self._find_egg_info_files(env.paths['lib']) expected = [ 'PKG-INFO', @@ -83,7 +83,7 @@ class TestEggInfo(object): } }) self._run_install_command(tmpdir_cwd, env) - egg_info_dir, _ = self._find_egg_info_files(env.paths['lib']) + egg_info_dir = self._find_egg_info_files(env.paths['lib']).base sources_txt = os.path.join(egg_info_dir, 'SOURCES.txt') assert 'docs/usage.rst' in open(sources_txt).read().split('\n') @@ -108,8 +108,13 @@ class TestEggInfo(object): raise AssertionError(data) def _find_egg_info_files(self, root): + class DirList(list): + def __init__(self, files, base): + super(DirList, self).__init__(files) + self.base = base + results = ( - (dirpath, filenames) + DirList(filenames, dirpath) for dirpath, dirnames, filenames in os.walk(root) if os.path.basename(dirpath) == 'EGG-INFO' ) |
