$97 GRAYBYTE WORDPRESS FILE MANAGER $57

SERVER : vnpttt-amd7f72-h1.vietnix.vn #1 SMP Fri May 24 12:42:50 UTC 2024
SERVER IP : 103.200.23.149 | ADMIN IP 216.73.216.22
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs/

HOME
Current File : /opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs//pytest_plugin.py
"""A pytest plugin for using pyfakefs as a fixture

When pyfakefs is installed, the "fs" fixture becomes available.

:Usage:

def my_fakefs_test(fs):
    fs.create_file('/var/data/xx1.txt')
    assert os.path.exists('/var/data/xx1.txt')
"""
import py
import pytest
from _pytest import capture

from pyfakefs.fake_filesystem_unittest import Patcher

try:
    from _pytest import pathlib
except ImportError:
    pathlib = None

Patcher.SKIPMODULES.add(py)
Patcher.SKIPMODULES.add(pytest)
Patcher.SKIPMODULES.add(capture)
if pathlib is not None:
    Patcher.SKIPMODULES.add(pathlib)


@pytest.fixture
def fs(request):
    """Fake filesystem."""
    if hasattr(request, "param"):
        # pass optional parameters via @pytest.mark.parametrize
        patcher = Patcher(*request.param)
    else:
        patcher = Patcher()
    patcher.setUp()
    yield patcher.fs
    patcher.tearDown()


@pytest.fixture(scope="class")
def fs_class(request):
    """Class-scoped fake filesystem fixture."""
    if hasattr(request, "param"):
        patcher = Patcher(*request.param)
    else:
        patcher = Patcher()
    patcher.setUp()
    yield patcher.fs
    patcher.tearDown()


@pytest.fixture(scope="module")
def fs_module(request):
    """Module-scoped fake filesystem fixture."""
    if hasattr(request, "param"):
        patcher = Patcher(*request.param)
    else:
        patcher = Patcher()
    patcher.setUp()
    yield patcher.fs
    patcher.tearDown()


@pytest.fixture(scope="session")
def fs_session(request):
    """Session-scoped fake filesystem fixture."""
    if hasattr(request, "param"):
        patcher = Patcher(*request.param)
    else:
        patcher = Patcher()
    patcher.setUp()
    yield patcher.fs
    patcher.tearDown()

Current_dir [ NOT WRITEABLE ] Document_root [ WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
17 Dec 2025 3.08 AM
root / root
0755
__pycache__
--
14 Aug 2025 9.24 PM
root / root
0755
pytest_tests
--
14 Aug 2025 9.24 PM
root / root
0755
tests
--
14 Aug 2025 9.24 PM
root / root
0755
__init__.py
0.055 KB
17 Apr 2025 8.10 PM
root / root
0644
_version.py
0.021 KB
17 Apr 2025 8.10 PM
root / root
0644
extra_packages.py
1.122 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_file.py
44.848 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_filesystem.py
113.951 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_filesystem_shutil.py
3.667 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_filesystem_unittest.py
41.687 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_io.py
5.95 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_open.py
13.07 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_os.py
49.607 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_path.py
17.489 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_pathlib.py
34.063 KB
17 Apr 2025 8.10 PM
root / root
0644
fake_scandir.py
11.058 KB
17 Apr 2025 8.10 PM
root / root
0644
helpers.py
12.868 KB
17 Apr 2025 8.10 PM
root / root
0644
mox3_stubout.py
5.776 KB
17 Apr 2025 8.10 PM
root / root
0644
patched_packages.py
4.302 KB
17 Apr 2025 8.10 PM
root / root
0644
py.typed
0.066 KB
17 Apr 2025 8.10 PM
root / root
0644
pytest_plugin.py
1.698 KB
17 Apr 2025 8.10 PM
root / root
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME
Static GIF