Package test :: Module regrtest :: Class saved_test_environment |
[hide private]
[frames] | no frames]

# Class saved_test_environment

source code

    Save bits of the test environment and restore them at block exit.

        with saved_test_environment(testname, verbose, quiet):
            #stuff

    Unless quiet is True, a warning is printed to stderr if any of
    the saved items was changed by the test.  The attribute 'changed'
    is initially False, but is set to True if a change is detected.

    If verbose is more than 1, the before and after state of changed
    items is also printed.

Instance Methods | [hide private]
__init__(self, testname, verbose=0, quiet=False) | source code
get_sys_argv(self) | source code
restore_sys_argv(self, saved_argv) | source code
get_cwd(self) | source code
restore_cwd(self, saved_cwd) | source code
get_sys_stdout(self) | source code
restore_sys_stdout(self, saved_stdout) | source code
get_sys_stderr(self) | source code
restore_sys_stderr(self, saved_stderr) | source code
get_sys_stdin(self) | source code
restore_sys_stdin(self, saved_stdin) | source code
get_os_environ(self) | source code
restore_os_environ(self, saved_environ) | source code
get_sys_path(self) | source code
restore_sys_path(self, saved_path) | source code
get_asyncore_socket_map(self) | source code
restore_asyncore_socket_map(self, saved_map) | source code
resource_info(self) | source code
__enter__(self) | source code
__exit__(self, exc_type, exc_val, exc_tb) | source code

Class Variables | [hide private]
| changed = `False`
| resources = ``(``'``sys.argv``'``,` `'``cwd``'``,` `'``sys.stdin``'``,` `'``sys.stdout``'``,` `'``sy``...``

Class Variable Details | [hide private]

  ### resources Value:
      ('sys.argv',
       'cwd',
       'sys.stdin',
       'sys.stdout',
       'sys.stderr',
       'os.environ',
       'sys.path',
       'asyncore.socket_map')