From d04904fcbfee5e1b2170cbe8d8f67519f8d9f8f9 2012-10-09 14:08:02 From: Takafumi Arakaki Date: 2012-10-09 14:08:02 Subject: [PATCH] Fix doctest_run_option_parser for Windows It should fix (part of) #2477. --- diff --git a/IPython/core/tests/test_run.py b/IPython/core/tests/test_run.py index dfc85d7..0bcdc4f 100644 --- a/IPython/core/tests/test_run.py +++ b/IPython/core/tests/test_run.py @@ -96,13 +96,42 @@ def doctest_run_option_parser(): In [2]: %run print_argv.py print*.py ['print_argv.py'] - In [3]: %run print_argv.py print\\*.py + In [3]: %run -G print_argv.py print*.py ['print*.py'] - In [4]: %run print_argv.py 'print*.py' + """ + + +@dec.skip_win32 +def doctest_run_option_parser_for_posix(): + r"""Test option parser in %run (Linux/OSX specific). + + You need double quote to escape glob in POSIX systems: + + In [1]: %run print_argv.py print\\*.py + ['print*.py'] + + You can't use quote to escape glob in POSIX systems: + + In [2]: %run print_argv.py 'print*.py' ['print_argv.py'] - In [5]: %run -G print_argv.py print*.py + """ + + +@dec.skip_linux +@dec.skip_osx +def doctest_run_option_parser_for_windows(): + r"""Test option parser in %run (Windows specific). + + In Windows, you can't escape ``*` `by backslash: + + In [1]: %run print_argv.py print\\*.py + ['print\\*.py'] + + You can use quote to escape glob: + + In [2]: %run print_argv.py 'print*.py' ['print*.py'] """