mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 18:28:24 +00:00
Add tests for python version compatibility (#14430)
This commit is contained in:
parent
d81b6cd334
commit
1f07880d5c
5 changed files with 80 additions and 2 deletions
|
@ -3408,7 +3408,9 @@ pub struct AnalyzeOptions {
|
|||
mod tests {
|
||||
use crate::options::Flake8SelfOptions;
|
||||
use ruff_linter::rules::flake8_self;
|
||||
use ruff_linter::settings::types::PythonVersion as LinterPythonVersion;
|
||||
use ruff_python_ast::name::Name;
|
||||
use ruff_python_formatter::PythonVersion as FormatterPythonVersion;
|
||||
|
||||
#[test]
|
||||
fn flake8_self_options() {
|
||||
|
@ -3456,4 +3458,28 @@ mod tests {
|
|||
vec![Name::new_static("_foo"), Name::new_static("_bar")]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn formatter_and_linter_target_version_have_same_default() {
|
||||
assert_eq!(
|
||||
FormatterPythonVersion::default().as_tuple(),
|
||||
LinterPythonVersion::default().as_tuple()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn formatter_and_linter_target_version_have_same_latest() {
|
||||
assert_eq!(
|
||||
FormatterPythonVersion::latest().as_tuple(),
|
||||
LinterPythonVersion::latest().as_tuple()
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn formatter_and_linter_target_version_have_same_minimal_supported() {
|
||||
assert_eq!(
|
||||
FormatterPythonVersion::minimal_supported().as_tuple(),
|
||||
LinterPythonVersion::minimal_supported().as_tuple()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue