Skip to content

Commit b65f394

Browse files
committed
Remove hard-coded indexes of metadata lines. Ref #2641.
1 parent fb37758 commit b65f394

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

setuptools/tests/test_egg_info.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -919,7 +919,7 @@ def test_license(self, tmpdir_cwd, env):
919919
egg_info_dir = os.path.join('.', 'foo.egg-info')
920920
with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file:
921921
pkg_info_lines = pkginfo_file.read().split('\n')
922-
assert 'License: MIT' == pkg_info_lines[7]
922+
assert 'License: MIT' in pkg_info_lines
923923

924924
def test_license_escape(self, tmpdir_cwd, env):
925925
"""Test license is escaped correctly if longer than one line."""
@@ -934,8 +934,10 @@ def test_license_escape(self, tmpdir_cwd, env):
934934
egg_info_dir = os.path.join('.', 'foo.egg-info')
935935
with open(os.path.join(egg_info_dir, 'PKG-INFO')) as pkginfo_file:
936936
pkg_info_lines = pkginfo_file.read().split('\n')
937-
assert 'License: This is a long license text ' == pkg_info_lines[7]
938-
assert ' over multiple lines' == pkg_info_lines[8]
937+
938+
assert 'License: This is a long license text ' in pkg_info_lines
939+
assert ' over multiple lines' in pkg_info_lines
940+
assert 'text \n over multiple' in '\n'.join(pkg_info_lines)
939941

940942
def test_python_requires_egg_info(self, tmpdir_cwd, env):
941943
self._setup_script_with_requires(

0 commit comments

Comments
 (0)