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
()
| 75 | |
| 76 | |
| 77 | def 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 | |
| 87 | def teardown_environment(): |
| 88 | """Restore things that were remembered by the setup_environment function |