Skip to content

TST: Fix MMapWrapper init test for Windows #13494

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 9 additions & 7 deletions pandas/io/tests/test_common.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
"""
Tests for the pandas.io.common functionalities
"""
import nose
import mmap
import os
from os.path import isabs
Expand Down Expand Up @@ -98,15 +97,18 @@ def setUp(self):
'test_mmap.csv')

def test_constructor_bad_file(self):
if is_platform_windows():
raise nose.SkipTest("skipping construction error messages "
"tests on windows")

non_file = StringIO('I am not a file')
non_file.fileno = lambda: -1

msg = "Invalid argument"
tm.assertRaisesRegexp(mmap.error, msg, common.MMapWrapper, non_file)
# the error raised is different on Windows
if is_platform_windows():
msg = "The parameter is incorrect"
err = OSError
else:
msg = "Invalid argument"
err = mmap.error

tm.assertRaisesRegexp(err, msg, common.MMapWrapper, non_file)

target = open(self.mmap_file, 'r')
target.close()
Expand Down