OXIESEC PANEL
- Current Dir:
/
/
opt
/
cloudlinux
/
venv
/
lib
/
python3.11
/
site-packages
/
pyfakefs
/
pytest_tests
Server IP: 2a02:4780:11:1084:0:327f:3464:10
Upload:
Create Dir:
Name
Size
Modified
Perms
📁
..
-
02/07/2025 10:01:35 PM
rwxr-xr-x
📄
__init__.py
0 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📁
__pycache__
-
02/07/2025 10:01:35 PM
rwxr-xr-x
📄
conftest.py
1.3 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
example.py
652 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
io.py
346 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
pytest_check_failed_plugin_test.py
658 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
pytest_doctest_test.py
1.39 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
pytest_fixture_param_test.py
1.87 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
pytest_fixture_test.py
1.91 KB
12/18/2024 10:23:15 AM
rw-r--r--
📄
pytest_module_fixture_test.py
894 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
pytest_plugin_failing_helper.py
129 bytes
12/18/2024 10:23:15 AM
rw-r--r--
📄
pytest_plugin_test.py
2.32 KB
12/18/2024 10:23:15 AM
rw-r--r--
Editing: pytest_doctest_test.py
Close
""" 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)