Skip to content

Commit 8b92581

Browse files
committed
fixup
1 parent 1d5c8dd commit 8b92581

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

tests/test_sdist.py

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,14 @@ def test_pep621(sdist_full_metadata):
3434
with tarfile.open(sdist_full_metadata, 'r:gz') as sdist:
3535
sdist_pkg_info = sdist.extractfile('full_metadata-1.2.3/PKG-INFO').read()
3636

37-
expected = metadata(textwrap.dedent('''\
37+
meta = metadata(sdist_pkg_info)
38+
39+
# pyproject-metadata prior to 0.8.0 incorrectly uses whitespace to separate keywords
40+
meta['keywords'] = list(chain(*(k.split(' ') for k in meta['keywords'])))
41+
# pyproject-metadata prior to 0.9.0 strips trailing newlines
42+
meta['license'] = meta['license'].rstrip()
43+
44+
assert meta == metadata(textwrap.dedent('''\
3845
Metadata-Version: 2.1
3946
Name: full-metadata
4047
Version: 1.2.3
@@ -71,15 +78,6 @@ def test_pep621(sdist_full_metadata):
7178
An example package with all of the PEP 621 metadata!
7279
'''))
7380

74-
meta = metadata(sdist_pkg_info)
75-
76-
# pyproject-metadata prior to 0.8.0 incorrectly uses whitespace to separate keywords
77-
meta['keywords'] = list(chain(*(k.split(' ') for k in meta['keywords'])))
78-
# pyproject-metadata prior to 0.9.0 strips trailing newlines
79-
meta['license'] = meta['license'].rstrip()
80-
81-
assert meta == expected
82-
8381

8482
def test_dynamic_version(sdist_dynamic_version):
8583
with tarfile.open(sdist_dynamic_version, 'r:gz') as sdist:

0 commit comments

Comments
 (0)