summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorfeuillemorte <fmorte@ya.ru>2018-04-13 16:00:07 +0300
committerfeuillemorte <fmorte@ya.ru>2018-04-13 16:00:07 +0300
commitba7cad3962d646768351bb12fb9922720c46f8f8 (patch)
treee22d5f5682d13bf38a1022bb29742dca26f1e797 /testing
parenta4daac7eb03f934752929297fe9d9329a4e86850 (diff)
downloadpytest-ba7cad3962d646768351bb12fb9922720c46f8f8.tar.gz
#3290 Fix comments
Diffstat (limited to 'testing')
-rw-r--r--testing/test_monkeypatch.py17
1 files changed, 8 insertions, 9 deletions
diff --git a/testing/test_monkeypatch.py b/testing/test_monkeypatch.py
index b524df89b..36ef083f7 100644
--- a/testing/test_monkeypatch.py
+++ b/testing/test_monkeypatch.py
@@ -329,14 +329,13 @@ def test_issue1338_name_resolving():
monkeypatch.undo()
-def test_context(testdir):
- testdir.makepyfile("""
+def test_context():
+ monkeypatch = MonkeyPatch()
+
import functools
- def test_partial(monkeypatch):
- with monkeypatch.context() as m:
- m.setattr(functools, "partial", 3)
- assert functools.partial == 3
- """)
+ import inspect
- result = testdir.runpytest()
- result.stdout.fnmatch_lines("*1 passed*")
+ with monkeypatch.context() as m:
+ m.setattr(functools, "partial", 3)
+ assert not inspect.isclass(functools.partial)
+ assert inspect.isclass(functools.partial)