File: test_fs_with_monkeypatch.py

package info (click to toggle)
python-pyfakefs 6.0.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 1,512 kB
  • sloc: python: 20,350; makefile: 8
file content (12 lines) | stat: -rw-r--r-- 348 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
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)