@@ -587,6 +587,8 @@ mod tests {
587587
588588 let test_env = create_test_env ( vec ! [ path1. clone( ) , path2. clone( ) ] ) ;
589589
590+ pyo3:: prepare_freethreaded_python ( ) ;
591+
590592 Python :: with_gil ( |py| {
591593 let initial_sys_path = get_sys_path ( py) ?;
592594 let initial_len = initial_sys_path. len ( ) ;
@@ -618,6 +620,8 @@ mod tests {
618620 fn test_activate_empty_sys_path ( ) -> PyResult < ( ) > {
619621 let test_env = create_test_env ( vec ! [ ] ) ;
620622
623+ pyo3:: prepare_freethreaded_python ( ) ;
624+
621625 Python :: with_gil ( |py| {
622626 let initial_sys_path = get_sys_path ( py) ?;
623627
@@ -642,6 +646,8 @@ mod tests {
642646
643647 let test_env = create_test_env ( vec ! [ path1. clone( ) , path2. clone( ) ] ) ;
644648
649+ pyo3:: prepare_freethreaded_python ( ) ;
650+
645651 Python :: with_gil ( |py| {
646652 let initial_sys_path = get_sys_path ( py) ?;
647653 let initial_len = initial_sys_path. len ( ) ;
@@ -689,6 +695,8 @@ mod tests {
689695
690696 let test_env = create_test_env ( vec ! [ valid_path. clone( ) , non_utf8_path. clone( ) ] ) ;
691697
698+ pyo3:: prepare_freethreaded_python ( ) ;
699+
692700 Python :: with_gil ( |py| {
693701 let initial_sys_path = get_sys_path ( py) ?;
694702 let initial_len = initial_sys_path. len ( ) ;
@@ -747,6 +755,8 @@ mod tests {
747755
748756 let test_env = create_test_env ( vec ! [ valid_path. clone( ) , non_utf8_path. clone( ) ] ) ;
749757
758+ pyo3:: prepare_freethreaded_python ( ) ;
759+
750760 Python :: with_gil ( |py| {
751761 let initial_sys_path = get_sys_path ( py) ?;
752762 let initial_len = initial_sys_path. len ( ) ;
0 commit comments