From 819ec5a81e046b2e7edf6485587d8c7242a3d1fe 2008-12-09 18:49:42 From: Jorgen Stenarson Date: 2008-12-09 18:49:42 Subject: [PATCH] Moved skip decorator to testing and created similar ones for OSX and linux, create delete testdirs in module setup/teardown --- diff --git a/IPython/testing/decorators.py b/IPython/testing/decorators.py index 6cbe0a7..99fc13b 100644 --- a/IPython/testing/decorators.py +++ b/IPython/testing/decorators.py @@ -155,6 +155,11 @@ def skip(msg=''): return inner # 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',"This test does not run under Linux") -skip_osx = skipif(sys.platform=='darwin',"This test does not run under OSX") +skip_win32 = skipif(sys.platform == 'win32',"This test does not run under Windows") +skip_linux = skipif(sys.platform == 'linux2',"This test does not run under Linux") +skip_osx = skipif(sys.platform == 'darwin',"This test does not run under OSX") + +# 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', "This test only runs under Linux") +skip_if_not_osx = skipif(sys.platform != 'darwin', "This test only runs under OSX") diff --git a/IPython/tests/test_genutils.py b/IPython/tests/test_genutils.py index fbf7a34..8685ff1 100644 --- a/IPython/tests/test_genutils.py +++ b/IPython/tests/test_genutils.py @@ -38,7 +38,20 @@ except ImportError: test_file_path = split(abspath(__file__))[0] -#skip_if_not_win32 = skipif(sys.platform!='win32',"This test only runs under Windows") +# + +def setup(): + try: + os.makedirs("home_test_dir/_ipython") + except WindowsError: + pass #Or should we complain that the test directory already exists?? + +def teardown(): + try: + os.removedirs("home_test_dir/_ipython") + except WindowsError: + pass #Or should we complain that the test directory already exists?? + def setup_environment(): global oldstuff, platformstuff