File: conftest.py

package info (click to toggle)
paste 1.7.1-1%2Blenny1
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 2,132 kB
  • ctags: 2,681
  • sloc: python: 20,173; sh: 73; makefile: 50
file content (28 lines) | stat: -rw-r--r-- 678 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import sys
import os

sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))

import pkg_resources
pkg_resources.require('Paste')

import py
"""
Option = py.test.Config.Option
option = py.test.Config.addoptions(
    "Paste options",
    Option('-W',
           action="store_true", dest="raise_warnings",
           default=False,
           help="Turn warnings into errors"))

class SetupDirectory(py.test.collect.Directory):

    def __init__(self, *args, **kw):
        super(SetupDirectory, self).__init__(*args, **kw)
        if option.raise_warnings:
            import warnings
            warnings.filterwarnings('error')
        
Directory = SetupDirectory
"""