From 93500dbe00103146a977c66d8c8afac3120c49b0 2019-11-11 13:13:14 From: Nicholas Bollweg Date: 2019-11-11 13:13:14 Subject: [PATCH] add skip_win32_py38 decorator, skip another test --- diff --git a/IPython/testing/decorators.py b/IPython/testing/decorators.py index 91e7193..4539a72 100644 --- a/IPython/testing/decorators.py +++ b/IPython/testing/decorators.py @@ -108,9 +108,9 @@ def make_label_dec(label, ds=None): >>> slow = make_label_dec('slow') >>> slow.__doc__ "Labels a test as 'slow'." - + And one that uses multiple labels and a custom docstring: - + >>> rare = make_label_dec(['slow','hard'], ... "Mix labels 'slow' and 'hard' for rare tests.") >>> rare.__doc__ @@ -280,7 +280,7 @@ def module_not_available(module): def decorated_dummy(dec, name): """Return a dummy function decorated with dec, with the given name. - + Examples -------- import IPython.testing.decorators as dec @@ -318,6 +318,11 @@ _x11_skip_msg = "Skipped under *nix when X11/XOrg not available" skip_if_no_x11 = skipif(_x11_skip_cond, _x11_skip_msg) + +# Decorators to skip certain tests on specific platform/python combinations +skip_win32_py38 = skipif(sys.version_info > (3,8) and os.name == 'nt') + + # not a decorator itself, returns a dummy function to be used as setup def skip_file_no_x11(name): warnings.warn("The function `skip_file_no_x11` is deprecated since IPython 4.0", diff --git a/IPython/utils/tests/test_path.py b/IPython/utils/tests/test_path.py index 26b7d32..b34f9ca 100644 --- a/IPython/utils/tests/test_path.py +++ b/IPython/utils/tests/test_path.py @@ -21,11 +21,13 @@ import IPython from IPython import paths from IPython.testing import decorators as dec from IPython.testing.decorators import (skip_if_not_win32, skip_win32, - onlyif_unicode_paths,) + onlyif_unicode_paths, skipif, + skip_win32_py38,) from IPython.testing.tools import make_tempfile, AssertPrints from IPython.utils import path from IPython.utils.tempdir import TemporaryDirectory + # Platform-dependent imports try: import winreg as wreg @@ -128,7 +130,7 @@ def test_get_home_dir_2(): nt.assert_equal(home_dir, unfrozen) -@skipif(sys.version_info > (3,8) and os.name == 'nt') +@skip_win32_py38 @with_environment def test_get_home_dir_3(): """get_home_dir() uses $HOME if set""" @@ -146,6 +148,7 @@ def test_get_home_dir_4(): # this should still succeed, but we don't care what the answer is home = path.get_home_dir(False) +@skip_win32_py38 @with_environment def test_get_home_dir_5(): """raise HomeDirError if $HOME is specified, but not a writable dir"""