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

Function setup_environment

IPython/utils/tests/test_path.py:77–85  ·  view source on GitHub ↗

Setup testenvironment for some functions that are tested in this module. In particular this functions stores attributes and other things that we need to stub in some test functions. This needs to be done on a function level and not module level because each testfunction needs a prist

()

Source from the content-addressed store, hash-verified

75
76
77def setup_environment():
78 """Setup testenvironment for some functions that are tested
79 in this module. In particular this functions stores attributes
80 and other things that we need to stub in some test functions.
81 This needs to be done on a function level and not module level because
82 each testfunction needs a pristine environment.
83 """
84 global oldstuff, platformstuff
85 oldstuff = (env.copy(), os.name, sys.platform, path.get_home_dir, IPython.__file__, os.getcwd())
86
87def teardown_environment():
88 """Restore things that were remembered by the setup_environment function

Callers

nothing calls this directly

Calls 1

copyMethod · 0.45

Tested by

no test coverage detected