summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2015-01-02 10:15:02 -0500
committerJason R. Coombs <jaraco@jaraco.com>2015-01-02 10:15:02 -0500
commit0822c8ff070891e63471e63b67ea97ff9803c0f5 (patch)
tree18867dca9dca4128e10cbe78c7d593d1462d55eb
parentd7aa4bbad9497e548fd0c7b4f935fe1eb94ba613 (diff)
downloadpython-setuptools-git-0822c8ff070891e63471e63b67ea97ff9803c0f5.tar.gz
Extract method for _find_egg_info_files.
-rw-r--r--setuptools/tests/test_egg_info.py18
1 files changed, 13 insertions, 5 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index efc66c93..450c898e 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -63,10 +63,8 @@ class TestEggInfo:
)
if code:
raise AssertionError(data)
- egg_info = None
- for dirpath, dirnames, filenames in os.walk(paths['lib']):
- if os.path.basename(dirpath) == 'EGG-INFO':
- egg_info = sorted(filenames)
+
+ actual = self._find_egg_info_files(paths['lib'])
expected = [
'PKG-INFO',
@@ -76,4 +74,14 @@ class TestEggInfo:
'not-zip-safe',
'top_level.txt',
]
- assert egg_info == expected
+ assert sorted(actual) == expected
+
+ def _find_egg_info_files(self, root):
+ results = (
+ filenames
+ for dirpath, dirnames, filenames in os.walk(root)
+ if os.path.basename(dirpath) == 'EGG-INFO'
+ )
+ # expect exactly one result
+ result, = results
+ return result