mirror of
https://github.com/astral-sh/uv.git
synced 2025-07-07 13:25:00 +00:00
Add python-patch
feature to isolate tests that require Python patch versions to match our suite (#2940)
Closes https://github.com/astral-sh/uv/issues/2165 Follows https://github.com/astral-sh/uv/pull/2930
This commit is contained in:
parent
273de456ea
commit
c345a79b9b
7 changed files with 22 additions and 3 deletions
|
@ -133,6 +133,13 @@ def main(scenarios: list[Path], snapshot_update: bool = True):
|
|||
else []
|
||||
)
|
||||
|
||||
# Hack to track which scenarios require a specific Python patch version
|
||||
for scenario in data["scenarios"]:
|
||||
if "patch" in scenario["name"]:
|
||||
scenario["python_patch"] = True
|
||||
else:
|
||||
scenario["python_patch"] = False
|
||||
|
||||
# We don't yet support local versions that aren't expressed as direct dependencies.
|
||||
for scenario in data["scenarios"]:
|
||||
expected = scenario["expected"]
|
||||
|
|
|
@ -58,6 +58,9 @@ fn command(context: &TestContext, python_versions: &[&str]) -> Command {
|
|||
/// {{.}}
|
||||
{{/tree}}
|
||||
/// ```
|
||||
{{#python_patch}}
|
||||
#[cfg(feature = "python-patch")]
|
||||
{{/python_patch}}
|
||||
#[test]
|
||||
fn {{module_name}}() -> Result<()> {
|
||||
let context = TestContext::new("{{environment.python}}");
|
||||
|
|
|
@ -77,6 +77,9 @@ fn command(context: &TestContext) -> Command {
|
|||
/// {{.}}
|
||||
{{/tree}}
|
||||
/// ```
|
||||
{{#python_patch}}
|
||||
#[cfg(feature = "python-patch")]
|
||||
{{/python_patch}}
|
||||
#[test]
|
||||
fn {{module_name}}() {
|
||||
let context = TestContext::new("{{environment.python}}");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue