Skip to content

Commit 4051cff

Browse files
committed
uv/tests: update existing test
This is the test we tweaked a few commits back when we first removed the error checking in the resolver. We now add in some `uv sync` commands, including one that should fail.
1 parent a8d23da commit 4051cff

File tree

1 file changed

+37
-14
lines changed

1 file changed

+37
-14
lines changed

crates/uv/tests/it/lock_conflict.rs

Lines changed: 37 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1016,10 +1016,6 @@ fn extra_unconditional() -> Result<()> {
10161016
10171017
[tool.uv.sources]
10181018
proxy1 = { workspace = true }
1019-
1020-
[build-system]
1021-
requires = ["hatchling"]
1022-
build-backend = "hatchling.build"
10231019
"#,
10241020
)?;
10251021

@@ -1054,8 +1050,16 @@ fn extra_unconditional() -> Result<()> {
10541050
----- stderr -----
10551051
Resolved 6 packages in [TIME]
10561052
"###);
1053+
// This should error since we're enabling two conflicting extras.
1054+
uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###"
1055+
success: false
1056+
exit_code: 2
1057+
----- stdout -----
1058+
1059+
----- stderr -----
1060+
error: Found conflicting extras `proxy1[extra1]` and `proxy1[extra2]` enabled simultaneously
1061+
"###);
10571062

1058-
// An error should occur even when only one conflicting extra is enabled.
10591063
root_pyproject_toml.write_str(
10601064
r#"
10611065
[project]
@@ -1071,10 +1075,6 @@ fn extra_unconditional() -> Result<()> {
10711075
10721076
[tool.uv.sources]
10731077
proxy1 = { workspace = true }
1074-
1075-
[build-system]
1076-
requires = ["hatchling"]
1077-
build-backend = "hatchling.build"
10781078
"#,
10791079
)?;
10801080
uv_snapshot!(context.filters(), context.lock(), @r###"
@@ -1085,6 +1085,20 @@ fn extra_unconditional() -> Result<()> {
10851085
----- stderr -----
10861086
Resolved 6 packages in [TIME]
10871087
"###);
1088+
// This is fine because we are only enabling one
1089+
// extra, and thus, there is no conflict.
1090+
uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###"
1091+
success: true
1092+
exit_code: 0
1093+
----- stdout -----
1094+
1095+
----- stderr -----
1096+
Prepared 3 packages in [TIME]
1097+
Installed 3 packages in [TIME]
1098+
+ anyio==4.1.0
1099+
+ idna==3.6
1100+
+ sniffio==1.3.1
1101+
"###);
10881102

10891103
// And same thing for the other extra.
10901104
root_pyproject_toml.write_str(
@@ -1102,11 +1116,6 @@ fn extra_unconditional() -> Result<()> {
11021116
11031117
[tool.uv.sources]
11041118
proxy1 = { workspace = true }
1105-
1106-
[build-system]
1107-
requires = ["hatchling"]
1108-
build-backend = "hatchling.build"
1109-
11101119
"#,
11111120
)?;
11121121
uv_snapshot!(context.filters(), context.lock(), @r###"
@@ -1117,6 +1126,20 @@ fn extra_unconditional() -> Result<()> {
11171126
----- stderr -----
11181127
Resolved 6 packages in [TIME]
11191128
"###);
1129+
// This is fine because we are only enabling one
1130+
// extra, and thus, there is no conflict.
1131+
uv_snapshot!(context.filters(), context.sync().arg("--frozen"), @r###"
1132+
success: true
1133+
exit_code: 0
1134+
----- stdout -----
1135+
1136+
----- stderr -----
1137+
Prepared 1 package in [TIME]
1138+
Uninstalled 1 package in [TIME]
1139+
Installed 1 package in [TIME]
1140+
- anyio==4.1.0
1141+
+ anyio==4.2.0
1142+
"###);
11201143

11211144
Ok(())
11221145
}

0 commit comments

Comments
 (0)