import os import sys import time import signal import shutil import logging import optparse import tempfile import subprocess import warnings from salttesting import TestLoader, TextTestRunner try: from salttesting.ext import console width, height = console.getTerminalSize() PNUM = width except Exception: PNUM = 70 try: import xmlrunner except ImportError: xmlrunner = None def print_header(header, sep='~', top=True, bottom=True, inline=False, centered=False): ''' Allows some pretty printing of headers on the console, either with a "ruler" on bottom and/or top, inline, centered, etc.
import logging import platform import optparse import tempfile import traceback import subprocess import warnings from functools import partial from contextlib import closing from salttesting import TestLoader, TextTestRunner from salttesting.version import __version_info__ from salttesting.xmlunit import HAS_XMLRUNNER, XMLTestRunner try: from salttesting.ext import console WIDTH, HEIGHT = console.getTerminalSize() PNUM = WIDTH except Exception: PNUM = 70 # This is a completely random and meaningful number intended to identify our # own signal triggering. WEIRD_SIGNAL_NUM = -45654 # Let's setup a global exception hook handler which will log all exceptions # Store a reference to the original handler __GLOBAL_EXCEPTION_HANDLER = sys.excepthook def __global_logging_exception_handler(exc_type, exc_value, exc_traceback):
import os import sys import time import signal import shutil import logging import optparse import tempfile import subprocess import warnings from salttesting import TestLoader, TextTestRunner try: from salttesting.ext import console WIDTH, HEIGHT = console.getTerminalSize() PNUM = WIDTH except Exception: PNUM = 70 try: import xmlrunner except ImportError: xmlrunner = None def print_header(header, sep='~', top=True, bottom=True, inline=False,