Skip to content

Commit

Permalink
Fix for running tests under Windows
Browse files Browse the repository at this point in the history
Fixes #35
  • Loading branch information
adamreeve committed Aug 5, 2015
1 parent 3117e87 commit 0eb31cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
2 changes: 1 addition & 1 deletion nptdms/tdms.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def _initialise_data(self, memmap_dir=None):
memmap_file = tempfile.NamedTemporaryFile(
mode='w+b', prefix="nptdms_", dir=memmap_dir)
self.data = np.memmap(
memmap_file.name,
memmap_file.file,
mode='w+',
shape=(self.number_values,),
dtype=self.data_type.nptype)
Expand Down
3 changes: 1 addition & 2 deletions nptdms/test/tdms_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
import struct
import tempfile
from datetime import datetime
import tempfile

from nptdms import tdms

Expand All @@ -33,7 +32,7 @@ class TestFile(object):
"""Generate a TDMS file for testing"""

def __init__(self):
self.file = tempfile.TemporaryFile()
self.file = tempfile.NamedTemporaryFile().file
self.data = bytes()

def add_segment(self, metadata, data, toc=None, incomplete=False):
Expand Down

0 comments on commit 0eb31cb

Please sign in to comment.