From 4a52a71956a8d46fcb7294ac71734504bb09bcc2 Mon Sep 17 00:00:00 2001 From: S. Solomon Darnell Date: Fri, 28 Mar 2025 21:52:21 -0500 Subject: two version of R2R are here --- .../site-packages/numpy/compat/tests/__init__.py | 0 .../numpy/compat/tests/test_compat.py | 22 ++++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 .venv/lib/python3.12/site-packages/numpy/compat/tests/__init__.py create mode 100644 .venv/lib/python3.12/site-packages/numpy/compat/tests/test_compat.py (limited to '.venv/lib/python3.12/site-packages/numpy/compat/tests') diff --git a/.venv/lib/python3.12/site-packages/numpy/compat/tests/__init__.py b/.venv/lib/python3.12/site-packages/numpy/compat/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/.venv/lib/python3.12/site-packages/numpy/compat/tests/test_compat.py b/.venv/lib/python3.12/site-packages/numpy/compat/tests/test_compat.py new file mode 100644 index 00000000..d4391565 --- /dev/null +++ b/.venv/lib/python3.12/site-packages/numpy/compat/tests/test_compat.py @@ -0,0 +1,22 @@ +from os.path import join +from io import BufferedReader, BytesIO + +from numpy.compat import isfileobj +from numpy.testing import assert_ +from numpy.testing import tempdir + + +def test_isfileobj(): + with tempdir(prefix="numpy_test_compat_") as folder: + filename = join(folder, 'a.bin') + + with open(filename, 'wb') as f: + assert_(isfileobj(f)) + + with open(filename, 'ab') as f: + assert_(isfileobj(f)) + + with open(filename, 'rb') as f: + assert_(isfileobj(f)) + + assert_(isfileobj(BufferedReader(BytesIO())) is False) -- cgit v1.2.3