Skip to content

Commit

Permalink
Merge pull request #1740 from davidhewitt/mod-tests
Browse files Browse the repository at this point in the history
testing: use `mod tests` instead of `mod test`
  • Loading branch information
davidhewitt authored Jul 26, 2021
2 parents bbe0e84 + a7244b8 commit 3241467
Show file tree
Hide file tree
Showing 27 changed files with 29 additions and 29 deletions.
2 changes: 1 addition & 1 deletion pyo3-macros-backend/src/pyfunction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ where
}

#[cfg(test)]
mod test {
mod tests {
use crate::types::{IntoPyDict, PyAny, PyDict, PyList};
use crate::{Python, ToPyObject};

Expand Down
4 changes: 2 additions & 2 deletions src/conversions/array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ mod min_const_generics {
}

#[cfg(test)]
mod test {
mod tests {
use super::*;
use std::{
panic,
Expand Down Expand Up @@ -257,7 +257,7 @@ fn invalid_sequence_length(expected: usize, actual: usize) -> PyErr {
}

#[cfg(test)]
mod test {
mod tests {
use crate::{PyResult, Python};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/conversions/osstr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ impl<'a> IntoPy<PyObject> for &'a OsString {
}

#[cfg(test)]
mod test {
mod tests {
use crate::{types::PyString, IntoPy, PyObject, Python, ToPyObject};
use std::fmt::Debug;
use std::{
Expand Down
2 changes: 1 addition & 1 deletion src/conversions/path.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl<'a> IntoPy<PyObject> 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;
Expand Down
2 changes: 1 addition & 1 deletion src/exceptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/gil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/marshal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ where
}

#[cfg(test)]
mod test {
mod tests {
use super::*;
use crate::types::PyDict;

Expand Down
2 changes: 1 addition & 1 deletion src/num_bigint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ bigint_conversion!(
);

#[cfg(test)]
mod test {
mod tests {
use super::*;
use crate::types::{PyDict, PyModule};
use indoc::indoc;
Expand Down
2 changes: 1 addition & 1 deletion src/num_complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/python.rs
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,7 @@ impl<'p> Python<'p> {
}

#[cfg(test)]
mod test {
mod tests {
use super::*;
use crate::types::{IntoPyDict, PyList};

Expand Down
2 changes: 1 addition & 1 deletion src/types/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -682,7 +682,7 @@ impl PyAny {
}

#[cfg(test)]
mod test {
mod tests {
use crate::{
types::{IntoPyDict, PyList, PyLong, PyModule},
Python, ToPyObject,
Expand Down
2 changes: 1 addition & 1 deletion src/types/boolobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/types/bytearray.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ impl PyByteArray {
}

#[cfg(test)]
mod test {
mod tests {
use crate::exceptions;
use crate::types::PyByteArray;
use crate::{PyObject, Python};
Expand Down
2 changes: 1 addition & 1 deletion src/types/bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions src/types/complex.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/types/dict.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down
2 changes: 1 addition & 1 deletion src/types/floatob.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))]
Expand Down
2 changes: 1 addition & 1 deletion src/types/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ where
}

#[cfg(test)]
mod test {
mod tests {
use crate::types::PyList;
use crate::Python;
use crate::{IntoPy, PyObject, PyTryFrom, ToPyObject};
Expand Down
2 changes: 1 addition & 1 deletion src/types/module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,7 @@ impl PyModule {
}

#[cfg(test)]
mod test {
mod tests {
use crate::{types::PyModule, Python};

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/types/num.rs
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ mod test_128bit_intergers {
}

#[cfg(test)]
mod test {
mod tests {
use crate::Python;
use crate::ToPyObject;

Expand Down
2 changes: 1 addition & 1 deletion src/types/sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/types/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/types/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down
2 changes: 1 addition & 1 deletion src/types/tuple.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3241467

Please sign in to comment.