Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Display path separators as backslashes on Windows#11667

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jtfmumm merged 3 commits intomainfromjtfm/windows-path-separators
Feb 20, 2025
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
Use custom filters for windows test
  • Loading branch information
@jtfmumm
jtfmumm committedFeb 20, 2025
commit0e2e7a78da93718b7a172720634fc2b42887f3db
27 changes: 27 additions & 0 deletionscrates/uv/tests/it/common/mod.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -250,6 +250,19 @@ impl TestContext {
self
}

/// Add a filter that ignores temporary directory in path.
pub fn with_filtered_windows_temp_dir(mut self) -> Self {
let pattern = regex::escape(
&self
.temp_dir
.simplified_display()
.to_string()
.replace('/', "\\"),
);
self.filters.push((pattern, "[TEMP_DIR]".to_string()));
self
}

/// Add extra directories and configuration for managed Python installations.
#[must_use]
pub fn with_managed_python_dirs(mut self) -> Self {
Expand All@@ -267,6 +280,12 @@ impl TestContext {
self
}

/// Clear filters on `TestContext`.
pub fn clear_filters(mut self) -> Self {
self.filters.clear();
self
}

/// Discover the path to the XDG state directory. We use this, rather than the OS-specific
/// temporary directory, because on macOS (and Windows on GitHub Actions), they involve
/// symlinks. (On macOS, the temporary directory is, like `/var/...`, which resolves to
Expand DownExpand Up@@ -988,6 +1007,14 @@ impl TestContext {
.collect()
}

/// Only the filters added to this test context.
pub fn filters_without_standard_filters(&self) -> Vec<(&str, &str)> {
self.filters
.iter()
.map(|(p, r)| (p.as_str(), r.as_str()))
.collect()
}

/// For when we add pypy to the test suite.
#[allow(clippy::unused_self)]
pub fn python_kind(&self) -> &'static str {
Expand Down
10 changes: 6 additions & 4 deletionscrates/uv/tests/it/tool_list.rs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -67,7 +67,9 @@ fn tool_list_paths() {
#[cfg(windows)]
#[test]
fn tool_list_paths_windows() {
let context = TestContext::new("3.12").with_filtered_exe_suffix();
let context = TestContext::new("3.12")
.clear_filters()
.with_filtered_windows_temp_dir();
let tool_dir = context.temp_dir.child("tools");
let bin_dir = context.temp_dir.child("bin");

Expand All@@ -80,15 +82,15 @@ fn tool_list_paths_windows() {
.assert()
.success();

uv_snapshot!(context.filters(), context.tool_list().arg("--show-paths")
uv_snapshot!(context.filters_without_standard_filters(), context.tool_list().arg("--show-paths")
.env(EnvVars::UV_TOOL_DIR, tool_dir.as_os_str())
.env(EnvVars::XDG_BIN_HOME, bin_dir.as_os_str()), @r###"
success: true
exit_code: 0
----- stdout -----
black v24.2.0 ([TEMP_DIR]\tools\black)
- black ([TEMP_DIR]\bin\black)
- blackd ([TEMP_DIR]\bin\blackd)
- black.exe ([TEMP_DIR]\bin\black.exe)
- blackd.exe ([TEMP_DIR]\bin\blackd.exe)

----- stderr -----
"###);
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp