Skip to content

Commit

Permalink
removed mutation of global state, changed filter addition in Warnings…
Browse files Browse the repository at this point in the history
…Recorder
  • Loading branch information
chiller committed Sep 21, 2015
1 parent beaa8e5 commit 9f77a85
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions _pytest/recwarn.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ def deprecated_call(func=None, *args, **kwargs):
... myobject.deprecated_method()
"""
if not func:
warnings.simplefilter('always')
return WarningsChecker(expected_warning=DeprecationWarning)

wrec = WarningsRecorder()
Expand Down Expand Up @@ -158,8 +157,8 @@ def showwarning(message, category, filename, lineno,
self._module.showwarning = showwarning

# allow the same warning to be raised more than once
self._module.simplefilter('always', append=True)

self._module.simplefilter('always')
return self

def __exit__(self, *exc_info):
Expand Down

0 comments on commit 9f77a85

Please sign in to comment.