Preview: test_fs_with_monkeypatch.py
Size: 348 B
/opt/cloudlinux/venv/lib64/python3.11/site-packages/pyfakefs/pytest_tests/test_fs_with_monkeypatch.py
from pyfakefs.fake_filesystem import FakeFileOpen
def test_monkeypatch_with_fs(fs, monkeypatch):
"""Regression test for issue 1200"""
fake_open = FakeFileOpen(fs)
monkeypatch.setattr("builtins.open", fake_open, raising=False)
def test_open():
"""Tests if open is poisoned by the above test"""
assert "built-in" in str(open)
Directory Contents
Dirs: 4 × Files: 19