Check that IPython starts with non-ascii characters in the IP dir.
()
| 32 | |
| 33 | @dec.onlyif_unicode_paths |
| 34 | def test_unicode_ipdir(): |
| 35 | """Check that IPython starts with non-ascii characters in the IP dir.""" |
| 36 | ipdir = tempfile.mkdtemp(suffix=u"€") |
| 37 | |
| 38 | # Create the config file, so it tries to load it. |
| 39 | with open(os.path.join(ipdir, 'ipython_config.py'), "w") as f: |
| 40 | pass |
| 41 | |
| 42 | old_ipdir1 = os.environ.pop("IPYTHONDIR", None) |
| 43 | old_ipdir2 = os.environ.pop("IPYTHON_DIR", None) |
| 44 | os.environ["IPYTHONDIR"] = ipdir |
| 45 | try: |
| 46 | app = BaseIPythonApplication() |
| 47 | # The lines below are copied from Application.initialize() |
| 48 | app.init_profile_dir() |
| 49 | app.init_config_files() |
| 50 | app.load_config_file(suppress_errors=False) |
| 51 | finally: |
| 52 | if old_ipdir1: |
| 53 | os.environ["IPYTHONDIR"] = old_ipdir1 |
| 54 | if old_ipdir2: |
| 55 | os.environ["IPYTHONDIR"] = old_ipdir2 |
| 56 | |
| 57 | def test_cli_priority(): |
| 58 | with TemporaryDirectory() as td: |
nothing calls this directly
no test coverage detected