From 0f709d6edc0337e5bd42a042199947f316dc076d Mon Sep 17 00:00:00 2001 From: kngwyu Date: Thu, 18 Jun 2020 18:01:57 +0900 Subject: [PATCH] Use paste instead of nightly concat_idents in datetime tests --- tests/test_datetime.rs | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/tests/test_datetime.rs b/tests/test_datetime.rs index 81e2010f230..f31148385ed 100644 --- a/tests/test_datetime.rs +++ b/tests/test_datetime.rs @@ -1,7 +1,3 @@ -#![cfg_attr(nightly, feature(concat_idents))] - -#[cfg(feature = "nightly")] -use pyo3::ffi::*; use pyo3::prelude::*; use pyo3::types::IntoPyDict; @@ -35,29 +31,26 @@ fn _get_subclasses<'p>( Ok((obj, sub_obj, sub_sub_obj)) } -#[cfg(feature = "nightly")] macro_rules! assert_check_exact { ($check_func:ident, $obj: expr) => { unsafe { - use pyo3::AsPyPointer; + use pyo3::{AsPyPointer, ffi::*}; assert!($check_func(($obj).as_ptr()) != 0); - assert!(concat_idents!($check_func, Exact)(($obj).as_ptr()) != 0); + assert!(pyo3::paste::expr!([<$check_func Exact>])(($obj).as_ptr()) != 0); } }; } -#[cfg(feature = "nightly")] macro_rules! assert_check_only { ($check_func:ident, $obj: expr) => { unsafe { - use pyo3::AsPyPointer; + use pyo3::{AsPyPointer, ffi::*}; assert!($check_func(($obj).as_ptr()) != 0); - assert!(concat_idents!($check_func, Exact)(($obj).as_ptr()) == 0); + assert!(pyo3::paste::expr!([<$check_func Exact>])(($obj).as_ptr()) == 0); } }; } -#[cfg(feature = "nightly")] #[test] fn test_date_check() { let gil = Python::acquire_gil(); @@ -69,7 +62,6 @@ fn test_date_check() { assert_check_only!(PyDate_Check, sub_sub_obj); } -#[cfg(feature = "nightly")] #[test] fn test_time_check() { let gil = Python::acquire_gil(); @@ -81,7 +73,6 @@ fn test_time_check() { assert_check_only!(PyTime_Check, sub_sub_obj); } -#[cfg(feature = "nightly")] #[test] fn test_datetime_check() { let gil = Python::acquire_gil(); @@ -96,7 +87,6 @@ fn test_datetime_check() { assert_check_only!(PyDateTime_Check, sub_sub_obj); } -#[cfg(feature = "nightly")] #[test] fn test_delta_check() { let gil = Python::acquire_gil();