Skip to content

Commit

Permalink
TST: Add tests for Python2, Python3 *.npy compatibility.
Browse files Browse the repository at this point in the history
  • Loading branch information
charris committed Oct 12, 2014
1 parent 8f068b7 commit 8b1f90a
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitattributes
@@ -1,2 +1,5 @@
* text=auto
tools/win32build/nsis_scripts/*.nsi.in eol=crlf

# Numerical data files
numpy/lib/tests/data/*.npy binary
Binary file added numpy/lib/tests/data/python3.npy
Binary file not shown.
Binary file added numpy/lib/tests/data/win64python2.npy
Binary file not shown.
10 changes: 10 additions & 0 deletions numpy/lib/tests/test_format.py
Expand Up @@ -524,6 +524,16 @@ def test_compressed_roundtrip():
assert_array_equal(arr, arr1)


def test_python2_python3_interoperability():
if sys.version_info[0] >= 3:
fname = 'win64python2.npy'
else:
fname = 'python3.npy'
path = os.path.join(os.path.dirname(__file__), 'data', fname)
data = np.load(path)
assert_array_equal(data, np.ones(2))


def test_version_2_0():
f = BytesIO()
# requires more than 2 byte for header
Expand Down

0 comments on commit 8b1f90a

Please sign in to comment.