blob: e639ec13fb1f455eaf9f04fee2c10b4b3d43555d (
plain)
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
"""
|