Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 819ec5a

Browse files
author
Jorgen Stenarson
committed
Moved skip decorator to testing and created similar ones for OSX and linux, create delete testdirs in module setup/teardown
1 parent 7b7c493 commit 819ec5a

2 files changed

Lines changed: 22 additions & 4 deletions

File tree

IPython/testing/decorators.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,11 @@ def wrapper(*a,**k):
155155
return inner
156156

157157
# Decorators to skip certain tests on specific platforms.
158-
skip_win32 = skipif(sys.platform=='win32',"This test does not run under Windows")
159-
skip_linux = skipif(sys.platform=='linux2',"This test does not run under Linux")
160-
skip_osx = skipif(sys.platform=='darwin',"This test does not run under OSX")
158+
skip_win32 = skipif(sys.platform == 'win32',"This test does not run under Windows")
159+
skip_linux = skipif(sys.platform == 'linux2',"This test does not run under Linux")
160+
skip_osx = skipif(sys.platform == 'darwin',"This test does not run under OSX")
161+
162+
# Decorators to skip tests if not on specific platforms.
163+
skip_if_not_win32 = skipif(sys.platform != 'win32', "This test only runs under Windows")
164+
skip_if_not_linux = skipif(sys.platform != 'linux2', "This test only runs under Linux")
165+
skip_if_not_osx = skipif(sys.platform != 'darwin', "This test only runs under OSX")

IPython/tests/test_genutils.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,20 @@
3838

3939
test_file_path = split(abspath(__file__))[0]
4040

41-
#skip_if_not_win32 = skipif(sys.platform!='win32',"This test only runs under Windows")
41+
#
42+
43+
def setup():
44+
try:
45+
os.makedirs("home_test_dir/_ipython")
46+
except WindowsError:
47+
pass #Or should we complain that the test directory already exists??
48+
49+
def teardown():
50+
try:
51+
os.removedirs("home_test_dir/_ipython")
52+
except WindowsError:
53+
pass #Or should we complain that the test directory already exists??
54+
4255

4356
def setup_environment():
4457
global oldstuff, platformstuff

0 commit comments

Comments
 (0)