From db7c6b1190f3e173dda5e0097bc5e65a835c0d90 Mon Sep 17 00:00:00 2001 From: gfyoung Date: Tue, 21 Jun 2016 04:56:36 -0400 Subject: [PATCH] TST: Fix MMapWrapper init test for Windows --- pandas/io/tests/test_common.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pandas/io/tests/test_common.py b/pandas/io/tests/test_common.py index 46c34abf5aeb7..cf5ec7d911051 100644 --- a/pandas/io/tests/test_common.py +++ b/pandas/io/tests/test_common.py @@ -1,7 +1,6 @@ """ Tests for the pandas.io.common functionalities """ -import nose import mmap import os from os.path import isabs @@ -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()