testing: use `mod tests` instead of `mod test`
This commit is contained in:
parent
bbe0e846b0
commit
a7244b864d
|
@ -459,7 +459,7 @@ fn type_is_pymodule(ty: &syn::Type) -> bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::{Argument, PyFunctionSignature};
|
use super::{Argument, PyFunctionSignature};
|
||||||
use proc_macro2::TokenStream;
|
use proc_macro2::TokenStream;
|
||||||
use quote::quote;
|
use quote::quote;
|
||||||
|
|
|
@ -647,7 +647,7 @@ impl_element!(f32, Float);
|
||||||
impl_element!(f64, Float);
|
impl_element!(f64, Float);
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::PyBuffer;
|
use super::PyBuffer;
|
||||||
use crate::ffi;
|
use crate::ffi;
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
|
|
|
@ -543,7 +543,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::types::{IntoPyDict, PyAny, PyDict, PyList};
|
use crate::types::{IntoPyDict, PyAny, PyDict, PyList};
|
||||||
use crate::{Python, ToPyObject};
|
use crate::{Python, ToPyObject};
|
||||||
|
|
||||||
|
|
|
@ -107,7 +107,7 @@ mod min_const_generics {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use std::{
|
use std::{
|
||||||
panic,
|
panic,
|
||||||
|
@ -257,7 +257,7 @@ fn invalid_sequence_length(expected: usize, actual: usize) -> PyErr {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::{PyResult, Python};
|
use crate::{PyResult, Python};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -152,7 +152,7 @@ impl<'a> IntoPy<PyObject> for &'a OsString {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject};
|
use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject};
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
use std::{
|
use std::{
|
||||||
|
|
|
@ -73,7 +73,7 @@ impl<'a> IntoPy<PyObject> for &'a PathBuf {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject};
|
use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject};
|
||||||
use std::borrow::Cow;
|
use std::borrow::Cow;
|
||||||
use std::fmt::Debug;
|
use std::fmt::Debug;
|
||||||
|
|
|
@ -332,7 +332,7 @@ pub mod socket {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::{PyException, PyUnicodeDecodeError};
|
use super::{PyException, PyUnicodeDecodeError};
|
||||||
use crate::types::{IntoPyDict, PyDict};
|
use crate::types::{IntoPyDict, PyDict};
|
||||||
use crate::{PyErr, Python};
|
use crate::{PyErr, Python};
|
||||||
|
|
|
@ -495,7 +495,7 @@ impl EnsureGIL {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::{gil_is_acquired, GILPool, GIL_COUNT, OWNED_OBJECTS, POOL};
|
use super::{gil_is_acquired, GILPool, GIL_COUNT, OWNED_OBJECTS, POOL};
|
||||||
use crate::{ffi, gil, AsPyPointer, IntoPyPointer, PyObject, Python, ToPyObject};
|
use crate::{ffi, gil, AsPyPointer, IntoPyPointer, PyObject, Python, ToPyObject};
|
||||||
use std::ptr::NonNull;
|
use std::ptr::NonNull;
|
||||||
|
|
|
@ -862,7 +862,7 @@ impl PyObject {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::{Py, PyObject};
|
use super::{Py, PyObject};
|
||||||
use crate::types::PyDict;
|
use crate::types::PyDict;
|
||||||
use crate::{ffi, AsPyPointer, Python};
|
use crate::{ffi, AsPyPointer, Python};
|
||||||
|
|
|
@ -51,7 +51,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::types::PyDict;
|
use crate::types::PyDict;
|
||||||
|
|
||||||
|
|
|
@ -144,7 +144,7 @@ bigint_conversion!(
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::types::{PyDict, PyModule};
|
use crate::types::{PyDict, PyModule};
|
||||||
use indoc::indoc;
|
use indoc::indoc;
|
||||||
|
|
|
@ -168,7 +168,7 @@ complex_conversion!(f32);
|
||||||
complex_conversion!(f64);
|
complex_conversion!(f64);
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
#[allow(clippy::float_cmp)] // The test wants to ensure that no precision was lost on the Python round-trip
|
#[allow(clippy::float_cmp)] // The test wants to ensure that no precision was lost on the Python round-trip
|
||||||
|
|
|
@ -678,7 +678,7 @@ impl<'p> Python<'p> {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use crate::types::{IntoPyDict, PyList};
|
use crate::types::{IntoPyDict, PyList};
|
||||||
|
|
||||||
|
|
|
@ -682,7 +682,7 @@ impl PyAny {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::{
|
use crate::{
|
||||||
types::{IntoPyDict, PyList, PyLong, PyModule},
|
types::{IntoPyDict, PyList, PyLong, PyModule},
|
||||||
Python, ToPyObject,
|
Python, ToPyObject,
|
||||||
|
|
|
@ -58,7 +58,7 @@ impl<'source> FromPyObject<'source> for bool {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::types::{PyAny, PyBool};
|
use crate::types::{PyAny, PyBool};
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
use crate::ToPyObject;
|
use crate::ToPyObject;
|
||||||
|
|
|
@ -165,7 +165,7 @@ impl PyByteArray {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::exceptions;
|
use crate::exceptions;
|
||||||
use crate::types::PyByteArray;
|
use crate::types::PyByteArray;
|
||||||
use crate::{PyObject, Python};
|
use crate::{PyObject, Python};
|
||||||
|
|
|
@ -114,7 +114,7 @@ impl<'a> FromPyObject<'a> for &'a [u8] {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::PyBytes;
|
use super::PyBytes;
|
||||||
use crate::FromPyObject;
|
use crate::FromPyObject;
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
|
|
|
@ -123,7 +123,7 @@ mod not_limited_impls {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::PyComplex;
|
use super::PyComplex;
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
use assert_approx_eq::assert_approx_eq;
|
use assert_approx_eq::assert_approx_eq;
|
||||||
|
@ -204,7 +204,7 @@ mod not_limited_impls {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::PyComplex;
|
use super::PyComplex;
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
use assert_approx_eq::assert_approx_eq;
|
use assert_approx_eq::assert_approx_eq;
|
||||||
|
|
|
@ -456,7 +456,7 @@ mod hashbrown_hashmap_conversion {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::conversion::IntoPy;
|
use crate::conversion::IntoPy;
|
||||||
use crate::types::dict::IntoPyDict;
|
use crate::types::dict::IntoPyDict;
|
||||||
#[cfg(not(PyPy))]
|
#[cfg(not(PyPy))]
|
||||||
|
|
|
@ -80,7 +80,7 @@ impl<'source> FromPyObject<'source> for f32 {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
#[cfg(not(Py_LIMITED_API))]
|
#[cfg(not(Py_LIMITED_API))]
|
||||||
use crate::ffi::PyFloat_AS_DOUBLE;
|
use crate::ffi::PyFloat_AS_DOUBLE;
|
||||||
#[cfg(not(Py_LIMITED_API))]
|
#[cfg(not(Py_LIMITED_API))]
|
||||||
|
|
|
@ -207,7 +207,7 @@ where
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::types::PyList;
|
use crate::types::PyList;
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
use crate::{IntoPy, PyObject, PyTryFrom, ToPyObject};
|
use crate::{IntoPy, PyObject, PyTryFrom, ToPyObject};
|
||||||
|
|
|
@ -420,7 +420,7 @@ impl PyModule {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::{types::PyModule, Python};
|
use crate::{types::PyModule, Python};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
@ -358,7 +358,7 @@ mod test_128bit_intergers {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
use crate::ToPyObject;
|
use crate::ToPyObject;
|
||||||
|
|
||||||
|
|
|
@ -330,7 +330,7 @@ impl<'v> PyTryFrom<'v> for PySequence {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::types::PySequence;
|
use crate::types::PySequence;
|
||||||
use crate::AsPyPointer;
|
use crate::AsPyPointer;
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
|
|
|
@ -405,7 +405,7 @@ mod hashbrown_hashset_conversion {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::{PyFrozenSet, PySet};
|
use super::{PyFrozenSet, PySet};
|
||||||
use crate::{IntoPy, PyObject, PyTryFrom, Python, ToPyObject};
|
use crate::{IntoPy, PyObject, PyTryFrom, Python, ToPyObject};
|
||||||
use std::collections::{BTreeSet, HashSet};
|
use std::collections::{BTreeSet, HashSet};
|
||||||
|
|
|
@ -191,7 +191,7 @@ impl FromPyObject<'_> for char {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use super::PyString;
|
use super::PyString;
|
||||||
use crate::Python;
|
use crate::Python;
|
||||||
use crate::{FromPyObject, PyObject, PyTryFrom, ToPyObject};
|
use crate::{FromPyObject, PyObject, PyTryFrom, ToPyObject};
|
||||||
|
|
|
@ -315,7 +315,7 @@ tuple_conversion!(
|
||||||
);
|
);
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod test {
|
mod tests {
|
||||||
use crate::types::{PyAny, PyTuple};
|
use crate::types::{PyAny, PyTuple};
|
||||||
use crate::{PyTryFrom, Python, ToPyObject};
|
use crate::{PyTryFrom, Python, ToPyObject};
|
||||||
use std::collections::HashSet;
|
use std::collections::HashSet;
|
||||||
|
|
Loading…
Reference in New Issue