Skip to content

Commit

Permalink
Ignore deprecation warnings during tests of browser:layer and browser…
Browse files Browse the repository at this point in the history
…:skin.
  • Loading branch information
philikon committed Feb 21, 2006
1 parent bf21b6a commit 20761f3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions browser/metaconfigure.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ def layer(_context, name=None, interface=None, base=IBrowserRequest,
bbb_aware=False):
"""Provides a new layer.
First, let's ignore the warnigns:
>>> warnings.filterwarnings('ignore', category=DeprecationWarning)
>>> class Info(object):
... file = u'doctest'
... line = 1
Expand Down Expand Up @@ -134,6 +137,9 @@ def layer(_context, name=None, interface=None, base=IBrowserRequest,
Traceback (most recent call last):
...
ConfigurationError: You cannot specify the 'interface' and 'base' together.
Enabling the warnings again:
>>> warnings.resetwarnings()
"""
if name is not None and ',' in name:
raise TypeError("Commas are not allowed in layer names.")
Expand Down Expand Up @@ -206,6 +212,9 @@ def layer(_context, name=None, interface=None, base=IBrowserRequest,
def skin(_context, name=None, interface=None, layers=None):
"""Provides a new skin.
First, let's ignore the warnigns:
>>> warnings.filterwarnings('ignore', category=DeprecationWarning)
>>> import pprint
>>> class Info(object):
... file = u'doctest'
Expand Down Expand Up @@ -271,6 +280,9 @@ def skin(_context, name=None, interface=None, layers=None):
Traceback (most recent call last):
...
ConfigurationError: You must specify the 'name' or 'interface' attribute.
Enabling the warnings again:
>>> warnings.resetwarnings()
"""
if name is None and interface is None:
raise ConfigurationError(
Expand Down

0 comments on commit 20761f3

Please sign in to comment.