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 21b3875e..ccc37611 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 7a22c477..69771e4d 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 914c2445..4d2d395e 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 1be641a0..31cde938 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 b05709b9..7efe4a51 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 7fc34baf..68affa2b 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 6a9faf91..a33fe9fe 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 a3b30d20..e28bef2c 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 6f83776f..21738cf4 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 156dcf75..6305eab4 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 1b4d05da..a021212d 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 24da2390..c69adf3f 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 0a319fb4..03fd9995 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 6669c3a3..a4e1dba7 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 7156efcf..54924be0 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 be59d0d5..38126483 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 81d7c889..c10d68d5 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 a4de4e0f..dae969e6 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 40cb1917..f5a11a9e 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 b0cd0302..2197a888 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 a078dd0b..ace26b0a 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 90536537..483b8a1a 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 4cc42abd..33953a03 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 5d4c5e07..a625e376 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 2db02253..00632333 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 44dd985e..7da450bb 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 1342ec40..4c09b75f 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;