diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-02 10:15:02 -0500 |
|---|---|---|
| committer | Jason R. Coombs <jaraco@jaraco.com> | 2015-01-02 10:15:02 -0500 |
| commit | 0822c8ff070891e63471e63b67ea97ff9803c0f5 (patch) | |
| tree | 18867dca9dca4128e10cbe78c7d593d1462d55eb /setuptools/tests/test_egg_info.py | |
| parent | d7aa4bbad9497e548fd0c7b4f935fe1eb94ba613 (diff) | |
| download | python-setuptools-git-0822c8ff070891e63471e63b67ea97ff9803c0f5.tar.gz | |
Extract method for _find_egg_info_files.
Diffstat (limited to 'setuptools/tests/test_egg_info.py')
| -rw-r--r-- | setuptools/tests/test_egg_info.py | 18 |
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 |
