Skip to content

Commit

Permalink
Remove try_fix CLI tests
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Jan 4, 2025
1 parent 4366cdf commit c58997d
Showing 1 changed file with 0 additions and 64 deletions.
64 changes: 0 additions & 64 deletions crates/ruff/tests/integration_test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2126,67 +2126,3 @@ unfixable = ["RUF"]

Ok(())
}

#[test]
fn verbose_show_failed_fix_errors() {
let mut cmd = RuffCheck::default()
.args(["--select", "UP006", "--preview", "-v"])
.build();

insta::with_settings!(
{
// the logs have timestamps we need to remove
filters => vec![(
r"\[[\d:-]+]",
""
)]
},{
assert_cmd_snapshot!(cmd
.pass_stdin("import typing\nCallable = 'abc'\ndef g() -> typing.Callable: ..."),
@r###"
success: false
exit_code: 1
----- stdout -----
-:3:12: UP006 Use `collections.abc.Callable` instead of `typing.Callable` for type annotation
|
1 | import typing
2 | Callable = 'abc'
3 | def g() -> typing.Callable: ...
| ^^^^^^^^^^^^^^^ UP006
|
= help: Replace with `collections.abc.Callable`
Found 1 error.
----- stderr -----
[ruff::resolve][DEBUG] Isolated mode, not reading any pyproject.toml
[ruff_diagnostics::diagnostic][DEBUG] Failed to create fix for NonPEP585Annotation: Unable to insert `Callable` into scope due to name conflict
"###); }
);
}

#[test]
fn no_verbose_hide_failed_fix_errors() {
let mut cmd = RuffCheck::default()
.args(["--select", "UP006", "--preview"])
.build();
assert_cmd_snapshot!(cmd
.pass_stdin("import typing\nCallable = 'abc'\ndef g() -> typing.Callable: ..."),
@r###"
success: false
exit_code: 1
----- stdout -----
-:3:12: UP006 Use `collections.abc.Callable` instead of `typing.Callable` for type annotation
|
1 | import typing
2 | Callable = 'abc'
3 | def g() -> typing.Callable: ...
| ^^^^^^^^^^^^^^^ UP006
|
= help: Replace with `collections.abc.Callable`
Found 1 error.
----- stderr -----
"###);
}

0 comments on commit c58997d

Please sign in to comment.