MCPcopy Create free account
hub / github.com/ipython/ipython / test_unicode_ipdir

Function test_unicode_ipdir

IPython/core/tests/test_application.py:34–55  ·  view source on GitHub ↗

Check that IPython starts with non-ascii characters in the IP dir.

()

Source from the content-addressed store, hash-verified

32
33@dec.onlyif_unicode_paths
34def 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
57def test_cli_priority():
58 with TemporaryDirectory() as td:

Callers

nothing calls this directly

Calls 5

init_profile_dirMethod · 0.95
init_config_filesMethod · 0.95
load_config_fileMethod · 0.95
popMethod · 0.80

Tested by

no test coverage detected