Backport module for sys.audit and sys.addaudithook mechanism
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

20 lines
723 B

import sys
import sysaudit
def test_module(): # type: () -> None
assert sysaudit.audit is not None
assert sysaudit.addaudithook is not None
if sys.version_info >= (3, 8, 0):
assert sysaudit.std_audit == sys.audit # type: ignore
assert sysaudit.std_addaudithook == sys.addaudithook # type: ignore
assert sysaudit.audit == sys.audit # type: ignore [attr-defined]
assert sysaudit.addaudithook == sys.addaudithook # type: ignore [attr-defined]
else:
assert sysaudit.audit == sysaudit.csysaudit_audit
assert sysaudit.addaudithook == sysaudit.csysaudit_addaudithook
assert sysaudit.py_audit is not None
assert sysaudit.py_addaudithook is not None