Skip to content

Commit

Permalink
easier way to include the test attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
MusicalNinjaDad committed Apr 18, 2024
1 parent bd67c4c commit ea0ad14
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions pyo3-testing/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ fn wrap_testcase(mut testcase: Pyo3TestCase) -> TokenStream2 {
let testfn_statements = testcase.statements;

let mut testfn: ItemFn = parse_quote!(
#[test]
#testfn_signature {
#(pyo3::append_to_inittab!(#o3_moduleidents);)* // allow python to import from each wrapped module
pyo3::prepare_freethreaded_python();
Expand All @@ -163,10 +164,6 @@ fn wrap_testcase(mut testcase: Pyo3TestCase) -> TokenStream2 {
}
);

testfn.attrs.push(parse_quote!(
#[test]
));

testfn.attrs.append(&mut testcase.otherattributes);

testfn.into_token_stream()
Expand Down

0 comments on commit ea0ad14

Please sign in to comment.