File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
nibabel/streamlines/tests Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change 6
6
7
7
import numpy as np
8
8
import pytest
9
- from numpy .compat .py3k import asbytes
10
9
11
10
import nibabel as nib
12
11
from nibabel .testing import clear_and_catch_warnings , data_path , error_warnings
@@ -95,7 +94,7 @@ def test_is_supported_detect_format(tmp_path):
95
94
# Valid file without extension
96
95
for tfile_cls in FORMATS .values ():
97
96
f = BytesIO ()
98
- f .write (asbytes ( tfile_cls .MAGIC_NUMBER ) )
97
+ f .write (tfile_cls .MAGIC_NUMBER )
99
98
f .seek (0 , os .SEEK_SET )
100
99
assert nib .streamlines .is_supported (f )
101
100
assert nib .streamlines .detect_format (f ) is tfile_cls
@@ -104,7 +103,7 @@ def test_is_supported_detect_format(tmp_path):
104
103
for tfile_cls in FORMATS .values ():
105
104
fpath = tmp_path / 'test.txt'
106
105
with open (fpath , 'w+b' ) as f :
107
- f .write (asbytes ( tfile_cls .MAGIC_NUMBER ) )
106
+ f .write (tfile_cls .MAGIC_NUMBER )
108
107
f .seek (0 , os .SEEK_SET )
109
108
assert nib .streamlines .is_supported (f )
110
109
assert nib .streamlines .detect_format (f ) is tfile_cls
You can’t perform that action at this time.
0 commit comments