Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions nibabel/streamlines/tests/test_streamlines.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@

import numpy as np
import pytest
from numpy.compat.py3k import asbytes

import nibabel as nib
from nibabel.testing import clear_and_catch_warnings, data_path, error_warnings
Expand Down Expand Up @@ -95,7 +94,7 @@ def test_is_supported_detect_format(tmp_path):
# Valid file without extension
for tfile_cls in FORMATS.values():
f = BytesIO()
f.write(asbytes(tfile_cls.MAGIC_NUMBER))
f.write(tfile_cls.MAGIC_NUMBER)
f.seek(0, os.SEEK_SET)
assert nib.streamlines.is_supported(f)
assert nib.streamlines.detect_format(f) is tfile_cls
Expand All @@ -104,7 +103,7 @@ def test_is_supported_detect_format(tmp_path):
for tfile_cls in FORMATS.values():
fpath = tmp_path / 'test.txt'
with open(fpath, 'w+b') as f:
f.write(asbytes(tfile_cls.MAGIC_NUMBER))
f.write(tfile_cls.MAGIC_NUMBER)
f.seek(0, os.SEEK_SET)
assert nib.streamlines.is_supported(f)
assert nib.streamlines.detect_format(f) is tfile_cls
Expand Down