From a7244b864d38b3ccb0ca07f0ca011bbd87a15256 Mon Sep 17 00:00:00 2001 From: David Hewitt <1939362+davidhewitt@users.noreply.github.com> Date: Mon, 26 Jul 2021 18:19:53 +0100 Subject: [PATCH] testing: use `mod tests` instead of `mod test` --- pyo3-macros-backend/src/pyfunction.rs | 2 +- src/buffer.rs | 2 +- src/conversion.rs | 2 +- src/conversions/array.rs | 4 ++-- src/conversions/osstr.rs | 2 +- src/conversions/path.rs | 2 +- src/exceptions.rs | 2 +- src/gil.rs | 2 +- src/instance.rs | 2 +- src/marshal.rs | 2 +- src/num_bigint.rs | 2 +- src/num_complex.rs | 2 +- src/python.rs | 2 +- src/types/any.rs | 2 +- src/types/boolobject.rs | 2 +- src/types/bytearray.rs | 2 +- src/types/bytes.rs | 2 +- src/types/complex.rs | 4 ++-- src/types/dict.rs | 2 +- src/types/floatob.rs | 2 +- src/types/list.rs | 2 +- src/types/module.rs | 2 +- src/types/num.rs | 2 +- src/types/sequence.rs | 2 +- src/types/set.rs | 2 +- src/types/string.rs | 2 +- src/types/tuple.rs | 2 +- 27 files changed, 29 insertions(+), 29 deletions(-) diff --git a/pyo3-macros-backend/src/pyfunction.rs b/pyo3-macros-backend/src/pyfunction.rs index 21b3875e068..ccc37611d93 100644 --- a/pyo3-macros-backend/src/pyfunction.rs +++ b/pyo3-macros-backend/src/pyfunction.rs @@ -459,7 +459,7 @@ fn type_is_pymodule(ty: &syn::Type) -> bool { } #[cfg(test)] -mod test { +mod tests { use super::{Argument, PyFunctionSignature}; use proc_macro2::TokenStream; use quote::quote; diff --git a/src/buffer.rs b/src/buffer.rs index 7a22c47717d..69771e4d50a 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -647,7 +647,7 @@ impl_element!(f32, Float); impl_element!(f64, Float); #[cfg(test)] -mod test { +mod tests { use super::PyBuffer; use crate::ffi; use crate::Python; diff --git a/src/conversion.rs b/src/conversion.rs index 914c244596f..4d2d395ee0f 100644 --- a/src/conversion.rs +++ b/src/conversion.rs @@ -543,7 +543,7 @@ where } #[cfg(test)] -mod test { +mod tests { use crate::types::{IntoPyDict, PyAny, PyDict, PyList}; use crate::{Python, ToPyObject}; diff --git a/src/conversions/array.rs b/src/conversions/array.rs index 1be641a0f07..31cde938242 100644 --- a/src/conversions/array.rs +++ b/src/conversions/array.rs @@ -107,7 +107,7 @@ mod min_const_generics { } #[cfg(test)] - mod test { + mod tests { use super::*; use std::{ panic, @@ -257,7 +257,7 @@ fn invalid_sequence_length(expected: usize, actual: usize) -> PyErr { } #[cfg(test)] -mod test { +mod tests { use crate::{PyResult, Python}; #[test] diff --git a/src/conversions/osstr.rs b/src/conversions/osstr.rs index b05709b93fe..7efe4a51558 100644 --- a/src/conversions/osstr.rs +++ b/src/conversions/osstr.rs @@ -152,7 +152,7 @@ impl<'a> IntoPy for &'a OsString { } #[cfg(test)] -mod test { +mod tests { use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject}; use std::fmt::Debug; use std::{ diff --git a/src/conversions/path.rs b/src/conversions/path.rs index 7fc34baf4c1..68affa2bd06 100644 --- a/src/conversions/path.rs +++ b/src/conversions/path.rs @@ -73,7 +73,7 @@ impl<'a> IntoPy for &'a PathBuf { } #[cfg(test)] -mod test { +mod tests { use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject}; use std::borrow::Cow; use std::fmt::Debug; diff --git a/src/exceptions.rs b/src/exceptions.rs index 6a9faf917ac..a33fe9fed1a 100644 --- a/src/exceptions.rs +++ b/src/exceptions.rs @@ -332,7 +332,7 @@ pub mod socket { } #[cfg(test)] -mod test { +mod tests { use super::{PyException, PyUnicodeDecodeError}; use crate::types::{IntoPyDict, PyDict}; use crate::{PyErr, Python}; diff --git a/src/gil.rs b/src/gil.rs index a3b30d20567..e28bef2c0a6 100644 --- a/src/gil.rs +++ b/src/gil.rs @@ -495,7 +495,7 @@ impl EnsureGIL { } #[cfg(test)] -mod test { +mod tests { use super::{gil_is_acquired, GILPool, GIL_COUNT, OWNED_OBJECTS, POOL}; use crate::{ffi, gil, AsPyPointer, IntoPyPointer, PyObject, Python, ToPyObject}; use std::ptr::NonNull; diff --git a/src/instance.rs b/src/instance.rs index 6f83776fe0d..21738cf42c4 100644 --- a/src/instance.rs +++ b/src/instance.rs @@ -862,7 +862,7 @@ impl PyObject { } #[cfg(test)] -mod test { +mod tests { use super::{Py, PyObject}; use crate::types::PyDict; use crate::{ffi, AsPyPointer, Python}; diff --git a/src/marshal.rs b/src/marshal.rs index 156dcf75719..6305eab4491 100644 --- a/src/marshal.rs +++ b/src/marshal.rs @@ -51,7 +51,7 @@ where } #[cfg(test)] -mod test { +mod tests { use super::*; use crate::types::PyDict; diff --git a/src/num_bigint.rs b/src/num_bigint.rs index 1b4d05da9e8..a021212d2d8 100644 --- a/src/num_bigint.rs +++ b/src/num_bigint.rs @@ -144,7 +144,7 @@ bigint_conversion!( ); #[cfg(test)] -mod test { +mod tests { use super::*; use crate::types::{PyDict, PyModule}; use indoc::indoc; diff --git a/src/num_complex.rs b/src/num_complex.rs index 24da23908a0..c69adf3f3c2 100644 --- a/src/num_complex.rs +++ b/src/num_complex.rs @@ -168,7 +168,7 @@ complex_conversion!(f32); complex_conversion!(f64); #[cfg(test)] -mod test { +mod tests { use super::*; #[allow(clippy::float_cmp)] // The test wants to ensure that no precision was lost on the Python round-trip diff --git a/src/python.rs b/src/python.rs index 0a319fb4142..03fd9995773 100644 --- a/src/python.rs +++ b/src/python.rs @@ -678,7 +678,7 @@ impl<'p> Python<'p> { } #[cfg(test)] -mod test { +mod tests { use super::*; use crate::types::{IntoPyDict, PyList}; diff --git a/src/types/any.rs b/src/types/any.rs index 6669c3a33d7..a4e1dba7414 100644 --- a/src/types/any.rs +++ b/src/types/any.rs @@ -682,7 +682,7 @@ impl PyAny { } #[cfg(test)] -mod test { +mod tests { use crate::{ types::{IntoPyDict, PyList, PyLong, PyModule}, Python, ToPyObject, diff --git a/src/types/boolobject.rs b/src/types/boolobject.rs index 7156efcf97a..54924be04fd 100644 --- a/src/types/boolobject.rs +++ b/src/types/boolobject.rs @@ -58,7 +58,7 @@ impl<'source> FromPyObject<'source> for bool { } #[cfg(test)] -mod test { +mod tests { use crate::types::{PyAny, PyBool}; use crate::Python; use crate::ToPyObject; diff --git a/src/types/bytearray.rs b/src/types/bytearray.rs index be59d0d5099..38126483dd8 100644 --- a/src/types/bytearray.rs +++ b/src/types/bytearray.rs @@ -165,7 +165,7 @@ impl PyByteArray { } #[cfg(test)] -mod test { +mod tests { use crate::exceptions; use crate::types::PyByteArray; use crate::{PyObject, Python}; diff --git a/src/types/bytes.rs b/src/types/bytes.rs index 81d7c88973d..c10d68d5f58 100644 --- a/src/types/bytes.rs +++ b/src/types/bytes.rs @@ -114,7 +114,7 @@ impl<'a> FromPyObject<'a> for &'a [u8] { } } #[cfg(test)] -mod test { +mod tests { use super::PyBytes; use crate::FromPyObject; use crate::Python; diff --git a/src/types/complex.rs b/src/types/complex.rs index a4de4e0f8ae..dae969e6d5f 100644 --- a/src/types/complex.rs +++ b/src/types/complex.rs @@ -123,7 +123,7 @@ mod not_limited_impls { } #[cfg(test)] - mod test { + mod tests { use super::PyComplex; use crate::Python; use assert_approx_eq::assert_approx_eq; @@ -204,7 +204,7 @@ mod not_limited_impls { } #[cfg(test)] -mod test { +mod tests { use super::PyComplex; use crate::Python; use assert_approx_eq::assert_approx_eq; diff --git a/src/types/dict.rs b/src/types/dict.rs index 40cb19177ff..f5a11a9e1ee 100644 --- a/src/types/dict.rs +++ b/src/types/dict.rs @@ -456,7 +456,7 @@ mod hashbrown_hashmap_conversion { } #[cfg(test)] -mod test { +mod tests { use crate::conversion::IntoPy; use crate::types::dict::IntoPyDict; #[cfg(not(PyPy))] diff --git a/src/types/floatob.rs b/src/types/floatob.rs index b0cd03021fb..2197a88809a 100644 --- a/src/types/floatob.rs +++ b/src/types/floatob.rs @@ -80,7 +80,7 @@ impl<'source> FromPyObject<'source> for f32 { } #[cfg(test)] -mod test { +mod tests { #[cfg(not(Py_LIMITED_API))] use crate::ffi::PyFloat_AS_DOUBLE; #[cfg(not(Py_LIMITED_API))] diff --git a/src/types/list.rs b/src/types/list.rs index a078dd0b854..ace26b0a138 100644 --- a/src/types/list.rs +++ b/src/types/list.rs @@ -207,7 +207,7 @@ where } #[cfg(test)] -mod test { +mod tests { use crate::types::PyList; use crate::Python; use crate::{IntoPy, PyObject, PyTryFrom, ToPyObject}; diff --git a/src/types/module.rs b/src/types/module.rs index 90536537ab1..483b8a1ac06 100644 --- a/src/types/module.rs +++ b/src/types/module.rs @@ -420,7 +420,7 @@ impl PyModule { } #[cfg(test)] -mod test { +mod tests { use crate::{types::PyModule, Python}; #[test] diff --git a/src/types/num.rs b/src/types/num.rs index 4cc42abd000..33953a03cca 100644 --- a/src/types/num.rs +++ b/src/types/num.rs @@ -358,7 +358,7 @@ mod test_128bit_intergers { } #[cfg(test)] -mod test { +mod tests { use crate::Python; use crate::ToPyObject; diff --git a/src/types/sequence.rs b/src/types/sequence.rs index 5d4c5e0716f..a625e376866 100644 --- a/src/types/sequence.rs +++ b/src/types/sequence.rs @@ -330,7 +330,7 @@ impl<'v> PyTryFrom<'v> for PySequence { } #[cfg(test)] -mod test { +mod tests { use crate::types::PySequence; use crate::AsPyPointer; use crate::Python; diff --git a/src/types/set.rs b/src/types/set.rs index 2db02253c31..00632333f93 100644 --- a/src/types/set.rs +++ b/src/types/set.rs @@ -405,7 +405,7 @@ mod hashbrown_hashset_conversion { } #[cfg(test)] -mod test { +mod tests { use super::{PyFrozenSet, PySet}; use crate::{IntoPy, PyObject, PyTryFrom, Python, ToPyObject}; use std::collections::{BTreeSet, HashSet}; diff --git a/src/types/string.rs b/src/types/string.rs index 44dd985ee95..7da450bb279 100644 --- a/src/types/string.rs +++ b/src/types/string.rs @@ -191,7 +191,7 @@ impl FromPyObject<'_> for char { } #[cfg(test)] -mod test { +mod tests { use super::PyString; use crate::Python; use crate::{FromPyObject, PyObject, PyTryFrom, ToPyObject}; diff --git a/src/types/tuple.rs b/src/types/tuple.rs index 1342ec408a8..4c09b75f240 100644 --- a/src/types/tuple.rs +++ b/src/types/tuple.rs @@ -315,7 +315,7 @@ tuple_conversion!( ); #[cfg(test)] -mod test { +mod tests { use crate::types::{PyAny, PyTuple}; use crate::{PyTryFrom, Python, ToPyObject}; use std::collections::HashSet;