@@ -7,11 +7,11 @@ use sqlx_macros_core::*;
77/// Constant used in all macros to define the macros namespace.
88/// This accommodates 3rd party drivers by allowing them to specify a different
99/// root crate that paths used with proc macros resolve to.
10- #[ cfg( not( test ) ) ]
10+ #[ cfg( not( sqlx_macros_namespace ) ) ]
1111const CRATE_NAME : & str = "sqlx" ;
1212// Allows for easier testing of the configurable macros namespace feature
1313// of current proc macros without duplicating them.
14- #[ cfg( test ) ]
14+ #[ cfg( sqlx_macros_namespace ) ]
1515const CRATE_NAME : & str = env ! ( "SQLX_NAMESPACE" ) ;
1616
1717#[ cfg( feature = "macros" ) ]
@@ -109,31 +109,3 @@ pub fn test(args: TokenStream, input: TokenStream) -> TokenStream {
109109 }
110110 }
111111}
112-
113- #[ cfg( test) ]
114- mod tests {
115- #[ test]
116- #[ cfg( feature = "migrate" ) ]
117- fn test_macros_namespace_migrate ( ) {
118- /// Import as different namespace.
119- ///
120- /// This must be set as `SQLX_NAMESPACE` environment variable to test that
121- /// changing the namespace still results in the proc macros behaving well.
122- extern crate sqlx as external;
123-
124- let _ = external:: migrate!( "../tests/migrate/migrations_simple" ) ;
125- }
126-
127- #[ test]
128- #[ cfg( feature = "derive" ) ]
129- fn test_macros_namespace_derive ( ) {
130- /// Import as different namespace.
131- ///
132- /// This must be set as `SQLX_NAMESPACE` environment variable to test that
133- /// changing the namespace still results in the proc macros behaving well.
134- extern crate sqlx as external;
135-
136- #[ derive( Debug , external:: Type , external:: Encode , external:: Decode , external:: FromRow ) ]
137- struct Test { }
138- }
139- }
0 commit comments