m2m模型翻译
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

19 lines
476 B

6 months ago
  1. from os.path import join
  2. from numpy.compat import isfileobj
  3. from numpy.testing import assert_
  4. from numpy.testing import tempdir
  5. def test_isfileobj():
  6. with tempdir(prefix="numpy_test_compat_") as folder:
  7. filename = join(folder, 'a.bin')
  8. with open(filename, 'wb') as f:
  9. assert_(isfileobj(f))
  10. with open(filename, 'ab') as f:
  11. assert_(isfileobj(f))
  12. with open(filename, 'rb') as f:
  13. assert_(isfileobj(f))