Skip to content

Commit 9701c46

Browse files
authored
Clippy rules (test related) (#7968)
1 parent 021c786 commit 9701c46

30 files changed

Lines changed: 1769 additions & 1738 deletions

File tree

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,11 @@ similar_names = "allow"
333333

334334
# restriction lints
335335
alloc_instead_of_core = "warn"
336+
cfg_not_test = "warn"
337+
redundant_test_prefix = "warn"
336338
std_instead_of_alloc = "warn"
337339
std_instead_of_core = "warn"
340+
tests_outside_test_module = "warn"
338341

339342
# nursery lints to enforce gradually
340343
debug_assert_with_mut_call = "warn"

crates/capi/src/pyerrors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ mod tests {
305305
use pyo3::prelude::*;
306306

307307
#[test]
308-
fn test_raised_exception() {
308+
fn raised_exception() {
309309
Python::attach(|py| {
310310
PyTypeError::new_err(py.None()).restore(py);
311311
assert!(PyErr::occurred(py));
@@ -315,7 +315,7 @@ mod tests {
315315
}
316316

317317
#[test]
318-
fn test_error_is_instance() {
318+
fn error_is_instance() {
319319
Python::attach(|py| {
320320
let err = PyTypeError::new_err(py.None());
321321
assert!(err.is_instance_of::<PyTypeError>(py));

crates/capi/src/pystate.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ mod tests {
5858
use rustpython_vm::vm::thread::{current_vm_is_set, with_current_vm};
5959

6060
#[test]
61-
fn test_new_thread() {
61+
fn new_thread() {
6262
Python::attach(|_py| {
6363
with_current_vm(|_vm| {
6464
assert!(
@@ -83,7 +83,7 @@ mod tests {
8383
}
8484

8585
#[test]
86-
fn test_current_vm_main_thread() {
86+
fn current_vm_main_thread() {
8787
Python::initialize();
8888

8989
// let RustPython create a vm for this thread.
@@ -105,7 +105,7 @@ mod tests {
105105
}
106106

107107
#[test]
108-
fn test_gilstate_release_detaches_external_thread() {
108+
fn gilstate_release_detaches_external_thread() {
109109
Python::initialize();
110110

111111
std::thread::spawn(|| {

0 commit comments

Comments
 (0)