File: __init__.py

package info (click to toggle)
cherrypy3 18.10.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,284 kB
  • sloc: python: 17,564; makefile: 29; sh: 8
file content (22 lines) | stat: -rw-r--r-- 394 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Regression test suite for CherryPy."""

import os
import sys


def newexit():
    os._exit(1)


def setup():
    # We want to monkey patch sys.exit so that we can get some
    # information about where exit is being called.
    newexit._old = sys.exit
    sys.exit = newexit


def teardown():
    try:
        sys.exit = sys.exit._old
    except AttributeError:
        sys.exit = sys._exit