Skip to content

Commit

Permalink
tests/common.rs -> src/tests/common.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhewitt committed Sep 24, 2023
1 parent c8f82be commit 7d486bb
Show file tree
Hide file tree
Showing 31 changed files with 31 additions and 2 deletions.
File renamed without changes.
2 changes: 1 addition & 1 deletion src/tests/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#[macro_use]
pub(crate) mod common {
use crate as pyo3;
include!("../../tests/common.rs");
include!("./common.rs");
}

/// Test macro hygiene - this is in the crate since we won't have
Expand Down
1 change: 1 addition & 0 deletions tests/test_arithmetics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pyo3::class::basic::CompareOp;
use pyo3::prelude::*;
use pyo3::py_run;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use std::{
};

#[macro_use]
#[path = "../src/tests/common.rs"]
mod common;

enum TestGetBufferError {
Expand Down
1 change: 1 addition & 0 deletions tests/test_buffer_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use std::ptr;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_bytes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use pyo3::prelude::*;
use pyo3::types::PyBytes;

#[path = "../src/tests/common.rs"]
mod common;

#[pyfunction]
Expand Down
1 change: 1 addition & 0 deletions tests/test_class_attributes.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use pyo3::prelude::*;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_class_basics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pyo3::prelude::*;
use pyo3::types::PyType;
use pyo3::{py_run, PyClass};

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_class_conversion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pyo3::prelude::*;
use pyo3::ToPyObject;

#[macro_use]
#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_default_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use pyo3::prelude::*;

#[path = "../src/tests/common.rs"]
mod common;

// Test default generated __repr__.
Expand Down
1 change: 1 addition & 0 deletions tests/test_enum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use pyo3::prelude::*;
use pyo3::{py_run, wrap_pyfunction};

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_exceptions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::fmt;
#[cfg(not(target_os = "windows"))]
use std::fs::File;

#[path = "../src/tests/common.rs"]
mod common;

#[pyfunction]
Expand Down
1 change: 1 addition & 0 deletions tests/test_frompyobject.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use pyo3::prelude::*;
use pyo3::types::{PyDict, PyList, PyString, PyTuple};

#[macro_use]
#[path = "../src/tests/common.rs"]
mod common;

/// Helper function that concatenates the error message from
Expand Down
1 change: 1 addition & 0 deletions tests/test_gc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use std::cell::Cell;
use std::sync::atomic::{AtomicBool, Ordering};
use std::sync::Arc;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass(freelist = 2)]
Expand Down
1 change: 1 addition & 0 deletions tests/test_getter_setter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use pyo3::prelude::*;
use pyo3::py_run;
use pyo3::types::{IntoPyDict, PyList};

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_inheritance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use pyo3::py_run;

use pyo3::types::IntoPyDict;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass(subclass)]
Expand Down
2 changes: 1 addition & 1 deletion tests/test_macro_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ use pyo3::prelude::*;
use pyo3::types::IntoPyDict;

#[macro_use]
#[path = "common.rs"]
#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
use pyo3::prelude::*;

#[macro_use]
#[path = "../src/tests/common.rs"]
mod common;

macro_rules! make_struct_using_macro {
Expand Down
1 change: 1 addition & 0 deletions tests/test_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use pyo3::types::PyList;
use pyo3::types::PyMapping;
use pyo3::types::PySequence;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass(mapping)]
Expand Down
1 change: 1 addition & 0 deletions tests/test_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use pyo3::py_run;
use pyo3::types::{IntoPyDict, PyDict, PyList, PySet, PyString, PyTuple, PyType};
use pyo3::PyCell;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
2 changes: 2 additions & 0 deletions tests/test_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use pyo3::prelude::*;

use pyo3::py_run;
use pyo3::types::{IntoPyDict, PyDict, PyTuple};

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_multiple_pymethods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pyo3::prelude::*;
use pyo3::types::PyType;

#[macro_use]
#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_proto_methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use pyo3::types::{PyDict, PyList, PyMapping, PySequence, PySlice, PyType};
use pyo3::{prelude::*, py_run, PyCell};
use std::{isize, iter};

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_pyfunction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use pyo3::types::PyDateTime;
use pyo3::types::PyFunction;
use pyo3::types::{self, PyCFunction};

#[path = "../src/tests/common.rs"]
mod common;

#[pyfunction(signature = (arg = true))]
Expand Down
1 change: 1 addition & 0 deletions tests/test_pyself.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use pyo3::types::{PyBytes, PyString};
use pyo3::PyCell;
use std::collections::HashMap;

#[path = "../src/tests/common.rs"]
mod common;

/// Assumes it's a file reader or so.
Expand Down
1 change: 1 addition & 0 deletions tests/test_sequence.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use pyo3::{ffi, prelude::*};

use pyo3::py_run;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_static_slots.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use pyo3::types::IntoPyDict;

use pyo3::py_run;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

use pyo3::prelude::*;

#[path = "../src/tests/common.rs"]
mod common;

#[pyfunction]
Expand Down
1 change: 1 addition & 0 deletions tests/test_text_signature.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pyo3::prelude::*;
use pyo3::types::{PyDict, PyTuple};
use pyo3::{types::PyType, wrap_pymodule, PyCell};

#[path = "../src/tests/common.rs"]
mod common;

#[test]
Expand Down
1 change: 1 addition & 0 deletions tests/test_variable_arguments.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use pyo3::prelude::*;
use pyo3::types::{PyDict, PyTuple};

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down
1 change: 1 addition & 0 deletions tests/test_various.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use pyo3::{py_run, PyCell};

use std::fmt;

#[path = "../src/tests/common.rs"]
mod common;

#[pyclass]
Expand Down

0 comments on commit 7d486bb

Please sign in to comment.