Skip to content

Commit

Permalink
Disable test on WASM which requires threads.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamreichold committed May 19, 2024
1 parent 49647ce commit 3cee3f0
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/gil.rs
Original file line number Diff line number Diff line change
Expand Up @@ -529,8 +529,17 @@ fn decrement_gil_count() {
mod tests {
use super::*;

use crate::{types::any::PyAnyMethods, PyObject};

use crate::types::any::PyAnyMethods;
#[cfg(any(
feature = "gil-refs",
all(not(pyo3_disable_reference_pool), not(target_arch = "wasm32")) // We are building wasm Python with pthreads disabled
))]
use crate::PyObject;

#[cfg(any(
feature = "gil-refs",
all(not(pyo3_disable_reference_pool), not(target_arch = "wasm32")) // We are building wasm Python with pthreads disabled
))]
fn get_object(py: Python<'_>) -> PyObject {
py.eval_bound("object()", None, None).unwrap().unbind()
}
Expand Down Expand Up @@ -622,6 +631,7 @@ mod tests {
}

#[test]
#[cfg(all(not(pyo3_disable_reference_pool), not(target_arch = "wasm32")))] // We are building wasm Python with pthreads disabled
fn test_pyobject_drop_with_gil_decreases_refcnt() {
Python::with_gil(|py| {
let obj = get_object(py);
Expand Down

0 comments on commit 3cee3f0

Please sign in to comment.