Skip to content

Commit

Permalink
check linux with startswith('linux') instead of =='linux2'
Browse files Browse the repository at this point in the history
This allows for sys.platform=='linux3'.

closes ipythongh-549
  • Loading branch information
minrk committed Jul 1, 2011
1 parent ec774ab commit 459a3da
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions IPython/testing/decorators.py
Expand Up @@ -297,15 +297,15 @@ def module_not_available(module):
# Decorators to skip certain tests on specific platforms.
skip_win32 = skipif(sys.platform == 'win32',
"This test does not run under Windows")
skip_linux = skipif(sys.platform == 'linux2',
skip_linux = skipif(sys.platform.startswith('linux'),
"This test does not run under Linux")
skip_osx = skipif(sys.platform == 'darwin',"This test does not run under OS X")


# Decorators to skip tests if not on specific platforms.
skip_if_not_win32 = skipif(sys.platform != 'win32',
"This test only runs under Windows")
skip_if_not_linux = skipif(sys.platform != 'linux2',
skip_if_not_linux = skipif(not sys.platform.startswith('linux'),
"This test only runs under Linux")
skip_if_not_osx = skipif(sys.platform != 'darwin',
"This test only runs under OSX")
Expand Down
2 changes: 1 addition & 1 deletion IPython/testing/tests/test_decorators.py
Expand Up @@ -176,7 +176,7 @@ def test_skip_dt_decorator2():

@dec.skip_linux
def test_linux():
nt.assert_not_equals(sys.platform,'linux2',"This test can't run under linux")
nt.assert_false(sys.platform.startswith('linux'),"This test can't run under linux")

@dec.skip_win32
def test_win32():
Expand Down

0 comments on commit 459a3da

Please sign in to comment.