"
config = Configuration(version_cls=MyVersion) # type: ignore[arg-type]
scm_version = meta("1.0.0-foo", config=config)
assert isinstance(scm_version.tag, MyVersion)
assert str(scm_version.tag) == "Custom 1.0.0-foo"
+
+
+@pytest.mark.parametrize("config_key", ["version_scheme", "local_scheme"])
+def test_no_matching_entrypoints(config_key: str) -> None:
+ version = meta(
+ "1.0",
+ config=replace(c, **{config_key: "nonexistant"}), # type: ignore
+ )
+ with pytest.raises(
+ ValueError,
+ match=(
+ r'Couldn\'t find any implementations for entrypoint "setuptools_scm\..*?"'
+ ' with value "nonexistant"'
+ ),
+ ):
+ format_version(version)
+
+
+def test_all_entrypoints_return_none() -> None:
+ version = meta(
+ "1.0",
+ config=replace(
+ c,
+ version_scheme=lambda v: None, # type: ignore
+ ),
+ )
+ with pytest.raises(
+ ValueError,
+ match=(
+ 'None of the "setuptools_scm.version_scheme" entrypoints matching'
+ r" .*? returned a value."
+ ),
+ ):
+ format_version(version)
diff --git a/testing/wd_wrapper.py b/testing/wd_wrapper.py
index 960bf44c..e1aa6c4f 100644
--- a/testing/wd_wrapper.py
+++ b/testing/wd_wrapper.py
@@ -1,6 +1,7 @@
from __future__ import annotations
import itertools
+
from pathlib import Path
from typing import Any
diff --git a/tox.ini b/tox.ini
index 87affcf0..049f2a77 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist=py{38,39,310,311},check_readme,check-dist
+envlist=py{38,39,310,311,312},check_readme,check-dist
requires= tox>4
[flake8]
@@ -9,11 +9,7 @@ ignore=E203,W503
[testenv]
usedevelop=True
-deps=
- pytest
- setuptools >= 45
- rich
- build
+extras=test
commands=
python -X warn_default_encoding -m pytest {posargs}
pFad - Phonifier reborn
Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.
Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.
Alternative Proxies:
Alternative Proxy
pFad Proxy
pFad v3 Proxy
pFad v4 Proxy