Commit 0f6a6779 authored by Robert Bradshaw's avatar Robert Bradshaw Committed by GitHub

Merge pull request #1792 from ChristopherHogan/chogan/skip_win32

skip_win32 doesn't properly skip tests
parents ae27370c 00b92d79
...@@ -42,11 +42,17 @@ if sys.platform == 'win32': ...@@ -42,11 +42,17 @@ if sys.platform == 'win32':
from unittest import skip as skip_win32 from unittest import skip as skip_win32
except ImportError: except ImportError:
# poor dev's silent @unittest.skip() # poor dev's silent @unittest.skip()
def skip_win32(f): def skip_win32(dummy):
return lambda self: None def _skip_win32(func):
return None
return _skip_win32
else: else:
def skip_win32(f): def skip_win32(dummy):
return f def _skip_win32(func):
def wrapper(*args, **kwargs):
func(*args, **kwargs)
return wrapper
return _skip_win32
class TestIPythonMagic(CythonTest): class TestIPythonMagic(CythonTest):
...@@ -60,7 +66,7 @@ class TestIPythonMagic(CythonTest): ...@@ -60,7 +66,7 @@ class TestIPythonMagic(CythonTest):
result = ip.run_cell_magic('cython_inline', '', 'return a+b') result = ip.run_cell_magic('cython_inline', '', 'return a+b')
self.assertEqual(result, 30) self.assertEqual(result, 30)
@skip_win32 @skip_win32('Skip on Windows')
def test_cython_pyximport(self): def test_cython_pyximport(self):
module_name = '_test_cython_pyximport' module_name = '_test_cython_pyximport'
ip.run_cell_magic('cython_pyximport', module_name, code) ip.run_cell_magic('cython_pyximport', module_name, code)
...@@ -111,7 +117,7 @@ class TestIPythonMagic(CythonTest): ...@@ -111,7 +117,7 @@ class TestIPythonMagic(CythonTest):
self.assertEqual(ip.user_ns['g'], 2 // 10) self.assertEqual(ip.user_ns['g'], 2 // 10)
self.assertEqual(ip.user_ns['h'], 2 // 10) self.assertEqual(ip.user_ns['h'], 2 // 10)
@skip_win32 @skip_win32('Skip on Windows')
def test_extlibs(self): def test_extlibs(self):
code = py3compat.str_to_unicode(""" code = py3compat.str_to_unicode("""
from libc.math cimport sin from libc.math cimport sin
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment