summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-05-09 11:37:21 -0400
committerJason R. Coombs <jaraco@jaraco.com>2021-05-09 11:37:21 -0400
commitb65f3944e8abf95b6a3c9165fad0ba86a9a5f351 (patch)
treef3b51dacadc80f8c2706a1f1e534562c44d3f4b2
parentfb377585d680cde6d1832ba7b6d90cfcdb463ee5 (diff)
downloadpython-setuptools-git-b65f3944e8abf95b6a3c9165fad0ba86a9a5f351.tar.gz
Remove hard-coded indexes of metadata lines. Ref #2641.
-rw-r--r--setuptools/tests/test_egg_info.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py
index 750193dd..0d595ad0 100644
--- a/setuptools/tests/test_egg_info.py
+++ b/setuptools/tests/test_egg_info.py
@@ -919,7 +919,7 @@ class TestEggInfo:
egg_info_dir = os.path.join('.', 'foo.egg-info')
with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file:
pkg_info_lines = pkginfo_file.read().split('\n')
- assert 'License: MIT' == pkg_info_lines[7]
+ assert 'License: MIT' in pkg_info_lines
def test_license_escape(self, tmpdir_cwd, env):
"""Test license is escaped correctly if longer than one line."""
@@ -934,8 +934,10 @@ class TestEggInfo:
egg_info_dir = os.path.join('.', 'foo.egg-info')
with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file:
pkg_info_lines = pkginfo_file.read().split('\n')
- assert 'License: This is a long license text ' == pkg_info_lines[7]
- assert ' over multiple lines' == pkg_info_lines[8]
+
+ assert 'License: This is a long license text ' in pkg_info_lines
+ assert ' over multiple lines' in pkg_info_lines
+ assert 'text \n over multiple' in '\n'.join(pkg_info_lines)
def test_python_requires_egg_info(self, tmpdir_cwd, env):
self._setup_script_with_requires(