Lines Matching +full:python +full:- +full:pathlib

5 --------------
18 .. code:: python
27 (invalid-name)``,
31 .. code:: python
34 def fake_filesystem(fs): # pylint:disable=invalid-name
40 Class-, module- and session-scoped fixtures
42 For convenience, class-, module- and session-scoped fixtures with the same
54 If you are using the Python ``unittest`` package, the easiest approach is to
61 .. code:: python
82 .. code:: python
92 pathlib.Path("/test/file1.txt").touch()
107 .. note:: This feature cannot be used with a Python version before Python 3.8 due to
118 you can do the patching using ``fake_filesystem_unittest.Patcher``--the class
124 .. code:: python
138 .. code:: python
153 .. code:: python
168 .. code:: python
195 .. code:: python
206 --------------------
222 .. code:: python
234 - The standard way to customize the ``fs`` fixture is to write your own
237 .. code:: python
252 - You can also pass the arguments using ``@pytest.mark.parametrize``. Note that
258 .. code:: python
273 .. code:: python
290 .. code:: python
315 - imported directly, for example:
317 .. code:: python
320 import pathlib.Path
322 - imported as another name:
324 .. code:: python
328 - imported using one of these two specially handled statements:
330 .. code:: python
333 from pathlib import Path
338 .. code:: python
345 .. code:: python
358 .. code:: python
370 .. code:: python
372 from pathlib import Path
380 .. code:: python
382 import pathlib
386 @click.argument("foo", type=click.Path(path_type=pathlib.Path))
400 .. code:: python
457 .. code:: python
513 used to avoid patching the Python file system modules themselves, but may be
518 .. code:: python
525 .. code:: python
538 your tests as a non-root user regardless of the actual user rights, you may
548 ``read_excel``, and for ``Django`` file locks--more may follow. Ordinarily,
551 may be removed or replaced by more fine-grained arguments in future releases.
555 Since Python 3.8, the ``io`` module has the function ``open_code``, which
556 opens a file read-only and is used to open Python code files. By default, this
565 .. code:: python
584 .. code:: python
600 - if default arguments are *computed* using file system functions:
602 .. code:: python
610 - if the default argument is an instance of ``pathlib.Path``:
612 .. code:: python
614 import pathlib
617 def foobar(dir_arg=pathlib.Path.cwd() / "logs"):
626 If True (the default), patched and non-patched modules are cached between tests
630 .. code:: python
644 .. code:: python
657 .. code:: python
667 -------------------------
668 While ``pyfakefs`` can be used just with the standard Python file system
683 size without contents--in this case, you will not be able to perform
685 with large files, see also :ref:`set-fs-size`).
687 .. code:: python
722 by default read-only, but even if you add them using ``read_only=False``,
730 .. code:: python
752 .. code:: python
780 .. code:: python
815 .. _set-fs-size:
830 .. code:: python
860 .. code:: python
878 .. code:: python
907 - ``is_windows_fs`` - if ``True`` a Windows file system (NTFS) is assumed
908 - ``is_macos`` - if ``True`` and ``is_windows_fs`` is ``False``, the
910 - if ``is_windows_fs`` and ``is_macos`` are ``False``, a Linux file system
912 - ``is_case_sensitive`` is set to ``True`` under Linux and to ``False``
913 under Windows and macOS by default - you can change it to change the
915 - ``path_separator`` is set to ``\`` under Windows and to ``/`` under Posix,
917 ``None`` under Posix--these can also be adapted if needed
921 .. code:: python
938 supported in the Python filesystem API. To make this possible to test, there is the
941 .. code:: python
945 path = pathlib.Path("/foo/bar")
956 .. _`example.py`: https://github.com/pytest-dev/pyfakefs/blob/main/pyfakefs/tests/example.py
957 .. _`example_test.py`: https://github.com/pytest-dev/pyfakefs/blob/main/pyfakefs/tests/example_test…
960 .. _`all Patcher arguments`: https://pytest-pyfakefs.readthedocs.io/en/latest/modules.html#pyfakefs…