diff options
author | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-03-29 03:03:09 +0100 |
---|---|---|
committer | Anderson Bravalheri <andersonbravalheri@gmail.com> | 2022-03-29 03:03:09 +0100 |
commit | 8bfc5f7164defc24386531e3f45cd223d4e275ba (patch) | |
tree | a3ef4f7907e98e33228db73d7f2147e058563d85 | |
parent | 16c3f1f69f6ea005c24b056f33bcd75259d976e5 (diff) | |
download | python-setuptools-git-8bfc5f7164defc24386531e3f45cd223d4e275ba.tar.gz |
Capture expectation of invalid version warning
-rw-r--r-- | setuptools/tests/test_dist_info.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/setuptools/tests/test_dist_info.py b/setuptools/tests/test_dist_info.py index 7f0e01cc..1387fcd1 100644 --- a/setuptools/tests/test_dist_info.py +++ b/setuptools/tests/test_dist_info.py @@ -1,6 +1,7 @@ """Test .dist-info style distributions. """ import pathlib +import re import subprocess import sys from functools import partial @@ -82,6 +83,15 @@ class TestDistInfo: ] assert d.extras == ['baz'] + def test_invalid_version(self, tmp_path): + config = "[metadata]\nname=proj\nversion=42\n[egg_info]\ntag_build=invalid!!!\n" + (tmp_path / "setup.cfg").write_text(config, encoding="utf-8") + msg = re.compile("invalid version", re.M | re.I) + output = run_command("dist_info", cwd=tmp_path) + assert msg.search(output) + dist_info = next(tmp_path.glob("*.dist-info")) + assert dist_info.name.startswith("proj-42") + class TestWheelCompatibility: SETUPCFG = DALS(""" |