SILENT KILLERPanel

Current Path: > > opt > cloudlinux > venv > lib > python3.11 > site-packages > pyfakefs > > pytest_tests


Operation   : Linux premium131.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
Software     : Apache
Server IP    : 162.0.232.56 | Your IP: 216.73.216.111
Domains      : 1034 Domain(s)
Permission   : [ 0755 ]

Files and Folders in: //opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs//pytest_tests

NameTypeSizeLast ModifiedActions
__pycache__ Directory - -
__init__.py File 0 bytes April 17 2025 13:10:58.
conftest.py File 1333 bytes April 17 2025 13:10:58.
example.py File 652 bytes April 17 2025 13:10:58.
io.py File 346 bytes April 17 2025 13:10:58.
pytest_check_failed_plugin_test.py File 658 bytes April 17 2025 13:10:58.
pytest_doctest_test.py File 1428 bytes April 17 2025 13:10:58.
pytest_fixture_param_test.py File 1913 bytes April 17 2025 13:10:58.
pytest_fixture_test.py File 1957 bytes April 17 2025 13:10:58.
pytest_module_fixture_test.py File 894 bytes April 17 2025 13:10:58.
pytest_plugin_failing_helper.py File 129 bytes April 17 2025 13:10:58.
pytest_plugin_test.py File 2380 bytes April 17 2025 13:10:58.

Reading File: //opt/cloudlinux/venv/lib/python3.11/site-packages/pyfakefs//pytest_tests/pytest_doctest_test.py

"""
This is a test case for pyfakefs issue #45.
This problem is resolved by using PyTest version 2.8.6 or above.

To run these doctests, install pytest and run:

    $ pytest --doctest-modules pytest_doctest_test.py

Add `-s` option to enable print statements.
"""
from __future__ import unicode_literals


def make_file_factory(func_name, fake, result):
    """Return a simple function with parametrized doctest."""

    def make_file(name, content=""):
        with open(name, "w") as f:
            f.write(content)

    make_file.__doc__ = """
        >>> import os
        >>> {command}
        >>> name, content = 'foo', 'bar'
        >>> {func_name}(name, content)
        >>> open(name).read() == content
        {result}
        >>> os.remove(name)  # Cleanup
        """.format(
        command="getfixture('fs')" if fake else "pass",
        func_name=func_name,
        result=result,
    )

    return make_file


passes = make_file_factory("passes", fake=False, result=True)
passes_too = make_file_factory("passes_too", fake=True, result=True)

passes_too.__doc__ = passes_too.__doc__.replace(">>> os.remove(name)", ">>> pass")

fails = make_file_factory("fails", fake=False, result=False)

# Pytest versions below 2.8.6 raise an internal error when running
# these doctests:
crashes = make_file_factory("crashes", fake=True, result=False)
crashes_too = make_file_factory(") SyntaxError", fake=True, result=False)

SILENT KILLER Tool