PyDocs

Development Tools

test.support.os_helper

The test.support.os_helper module provides support for os tests.
Symbols in test.support.os_helper

c

can_symlink
Return True if the OS supports symbolic links, False otherwise.
can_xattr
Return True if the OS supports xattr, False otherwise.
change_cwd
A context manager that temporarily changes the current working directory to path and yields the directory.
create_empty_file
Create an empty file with filename.

e

EnvironmentVarGuard
Class used to temporarily set or unset environment variables.

f

FakePath
Simple path-like object.
fd_count
Count the number of open file descriptors.
fs_is_case_insensitive
Return True if the file system for directory is case-insensitive.
FS_NONASCII
A non-ASCII character encodable by os.fsencode().

m

make_bad_fd
Create an invalid file descriptor by opening and closing a temporary file, and returning its descriptor.

r

rmdir
Call os.rmdir() on filename.
rmtree
Call shutil.rmtree() on path or call os.lstat() and os.rmdir() to remove a path and its contents.

s

SAVEDCWD
Set to os.getcwd().
skip_unless_symlink
A decorator for running tests that require support for symbolic links.
skip_unless_xattr
A decorator for running tests that require support for xattr.
SourceDateEpochTestMeta
Metaclass wrapping all test methods of the class with with_source_date_epoch() if the source_date_epoch keyword class argument is true, or with without_source_date_epoch() otherwise.

t

temp_cwd
A context manager that temporarily creates a new directory and changes the current working directory (CWD).
temp_dir
A context manager that creates a temporary directory at path and yields the directory.
temp_umask
A context manager that temporarily sets the process umask.
TESTFN
Set to a name that is safe to use as the name of a temporary file.
TESTFN_NONASCII
Set to a filename containing the FS_NONASCII character, if it exists.
TESTFN_UNDECODABLE
Set to a filename (bytes type) that should not be able to be decoded by file system encoding in strict mode.
TESTFN_UNENCODABLE
Set to a filename (str type) that should not be able to be encoded by file system encoding in strict mode.
TESTFN_UNICODE
Set to a non-ASCII name for a temporary file.

u

unlink
Call os.unlink() on filename.

w

with_source_date_epoch
A decorator for running tests with the SOURCE_DATE_EPOCH environment variable set to epoch.
without_source_date_epoch
A decorator for running tests with the SOURCE_DATE_EPOCH environment variable unset.