MCPcopy Index your code
hub / github.com/ipython/ipython / test_unicode_ipdir

Function test_unicode_ipdir

tests/test_application.py:33–54  ·  view source on GitHub ↗

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

()

Source from the content-addressed store, hash-verified

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

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

Used in the wild real call sites across dependent graphs

searching dependent graphs…