From b65f3944e8abf95b6a3c9165fad0ba86a9a5f351 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 9 May 2021 11:37:21 -0400 Subject: [PATCH] Remove hard-coded indexes of metadata lines. Ref #2641. --- setuptools/tests/test_egg_info.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/setuptools/tests/test_egg_info.py b/setuptools/tests/test_egg_info.py index 750193dd25..0d595ad078 100644 --- a/setuptools/tests/test_egg_info.py +++ b/setuptools/tests/test_egg_info.py @@ -919,7 +919,7 @@ def test_license(self, tmpdir_cwd, env): 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 @@ def test_license_escape(self, tmpdir_cwd, env): 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(