diff --git a/IPython/core/tests/test_history.py b/IPython/core/tests/test_history.py index e9f1247..5b485cf 100644 --- a/IPython/core/tests/test_history.py +++ b/IPython/core/tests/test_history.py @@ -134,5 +134,11 @@ def test_hist_file_config(): hm = HistoryManager(shell=get_ipython(), config=cfg) nt.assert_equals(hm.hist_file, cfg.HistoryManager.hist_file) finally: - os.remove(tfile.name) + try: + os.remove(tfile.name) + except OSError: + # same catch as in testing.tools.TempFileMixin + # On Windows, even though we close the file, we still can't + # delete it. I have no clue why + pass diff --git a/IPython/core/tests/test_profile.py b/IPython/core/tests/test_profile.py index 781c4c9..d3bbfe7 100644 --- a/IPython/core/tests/test_profile.py +++ b/IPython/core/tests/test_profile.py @@ -70,7 +70,16 @@ def teardown(): #----------------------------------------------------------------------------- # Test functions #----------------------------------------------------------------------------- +def win32_without_pywin32(): + if sys.platform == 'win32': + try: + import pywin32 + except ImportError: + return True + return False + +@dec.skipif(win32_without_pywin32(), "Test requires pywin32 on Windows") def test_startup_py(): # create profile dir pd = ProfileDir.create_profile_dir_by_name(IP_TEST_DIR, 'test') @@ -85,6 +94,7 @@ def test_startup_py(): tt.ipexec_validate(fname, '123', '', options=['--ipython-dir', IP_TEST_DIR, '--profile', 'test']) +@dec.skipif(win32_without_pywin32(), "Test requires pywin32 on Windows") def test_startup_ipy(): # create profile dir pd = ProfileDir.create_profile_dir_by_name(IP_TEST_DIR, 'test')