Merge remote-tracking branch 'upstream/features' into features

This commit is contained in:
turturica
2018-04-20 15:21:24 -07:00
4 changed files with 55 additions and 0 deletions

View File

@@ -327,3 +327,15 @@ def test_issue1338_name_resolving():
monkeypatch.delattr('requests.sessions.Session.request')
finally:
monkeypatch.undo()
def test_context():
monkeypatch = MonkeyPatch()
import functools
import inspect
with monkeypatch.context() as m:
m.setattr(functools, "partial", 3)
assert not inspect.isclass(functools.partial)
assert inspect.isclass(functools.partial)