Skip to content

Commit

Permalink
add a test
Browse files Browse the repository at this point in the history
  • Loading branch information
jessekv committed Aug 23, 2024
1 parent bf8d84d commit 23adf32
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
14 changes: 14 additions & 0 deletions crates/ruff_linter/src/rules/flake8_async/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ mod tests {

use crate::assert_messages;
use crate::registry::Rule;
use crate::settings::types::PythonVersion;
use crate::settings::LinterSettings;
use crate::test::test_path;

Expand All @@ -36,4 +37,17 @@ mod tests {
assert_messages!(snapshot, diagnostics);
Ok(())
}

#[test]
fn async109_python_310_or_older() -> Result<()> {
let diagnostics = test_path(
Path::new("flake8_async").join("ASYNC109_1.py"),
&LinterSettings {
target_version: PythonVersion::Py310,
..LinterSettings::for_rule(Rule::AsyncFunctionWithTimeout)
},
)?;
assert_messages!(diagnostics);
Ok(())
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
source: crates/ruff_linter/src/rules/flake8_async/mod.rs
---

0 comments on commit 23adf32

Please sign in to comment.