Skip to content

Commit fac5b2d

Browse files
committed
TST: Adapt to changes in pyproject-metadata 0.8.0
1 parent 18981b3 commit fac5b2d

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

tests/test_metadata.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-License-Identifier: MIT
44

55
import pathlib
6+
import re
67

78
import packaging.version
89
import pyproject_metadata
@@ -48,5 +49,10 @@ def test_missing_version(package_missing_version):
4849
pyproject = {'project': {
4950
'name': 'missing-version',
5051
}}
51-
with pytest.raises(pyproject_metadata.ConfigurationError, match='Required "project.version" field is missing'):
52+
match = '|'.join((
53+
re.escape('Required "project.version" field is missing'),
54+
# pyproject-metatadata 0.8.0 and later
55+
re.escape('Field "project.version" missing and "version" not specified in "project.dynamic"'),
56+
))
57+
with pytest.raises(pyproject_metadata.ConfigurationError, match=match):
5258
Metadata.from_pyproject(pyproject, pathlib.Path())

tests/test_sdist.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
# SPDX-License-Identifier: MIT
44

55
import os
6+
import re
67
import stat
78
import sys
89
import tarfile

0 commit comments

Comments
 (0)