MCPcopy Create free account
hub / github.com/apache/arrow / test_read_csv_gil_deadlock

Function test_read_csv_gil_deadlock

python/pyarrow/tests/test_csv.py:2205–2223  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2203
2204
2205def test_read_csv_gil_deadlock():
2206 # GH-38676
2207 # This test depends on several preconditions:
2208 # - the CSV input is a Python file object
2209 # - reading the CSV file produces an error
2210 data = b"a,b,c"
2211
2212 class MyBytesIO(io.BytesIO):
2213 def read(self, *args):
2214 time.sleep(0.001)
2215 return super().read(*args)
2216
2217 def readinto(self, *args):
2218 time.sleep(0.001)
2219 return super().readinto(*args)
2220
2221 for i in range(20):
2222 with pytest.raises(pa.ArrowInvalid):
2223 read_csv(MyBytesIO(data))
2224
2225
2226@pytest.mark.parametrize("tables,expected", [

Callers

nothing calls this directly

Calls 1

MyBytesIOClass · 0.85

Tested by

no test coverage detected