Skip to content

Commit 9e62889

Browse files
pre-commit-ci[bot]mrbean-bremen
authored andcommitted
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 7c24dcd commit 9e62889

23 files changed

+48
-38
lines changed

pyfakefs/fake_file.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""Fake implementations for different file objects.
16-
"""
15+
"""Fake implementations for different file objects."""
16+
1717
import errno
1818
import io
1919
import os

pyfakefs/fake_filesystem.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
>>> stat.S_ISDIR(os_module.stat(os_module.path.dirname(pathname)).st_mode)
8181
True
8282
"""
83+
8384
import errno
8485
import heapq
8586
import os
@@ -1221,12 +1222,10 @@ def joinpaths(self, *paths: AnyStr) -> AnyStr:
12211222
return matching_string(file_paths[0], "").join(joined_path_segments)
12221223

12231224
@overload
1224-
def _path_components(self, path: str) -> List[str]:
1225-
...
1225+
def _path_components(self, path: str) -> List[str]: ...
12261226

12271227
@overload
1228-
def _path_components(self, path: bytes) -> List[bytes]:
1229-
...
1228+
def _path_components(self, path: bytes) -> List[bytes]: ...
12301229

12311230
def _path_components(self, path: AnyStr) -> List[AnyStr]:
12321231
"""Breaks the path into a list of component names.

pyfakefs/fake_filesystem_shutil.py

+1
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
`fake_filesystem_unittest.TestCase`, pytest fs fixture,
2727
or directly `Patcher`.
2828
"""
29+
2930
import os
3031
import shutil
3132
import sys

pyfakefs/fake_filesystem_unittest.py

+7-6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
pyfakefs by simply changing their base class from `:py:class`unittest.TestCase`
3636
to `:py:class`pyfakefs.fake_filesystem_unittest.TestCase`.
3737
"""
38+
3839
import _io # type:ignore[import]
3940
import doctest
4041
import functools
@@ -730,12 +731,12 @@ def _init_fake_module_functions(self) -> None:
730731
fake_module = fake_filesystem.FakePathModule
731732
for fct_name in fake_module.dir():
732733
module_attr = (getattr(fake_module, fct_name), PATH_MODULE)
733-
self._fake_module_functions.setdefault(fct_name, {})[
734-
"genericpath"
735-
] = module_attr
736-
self._fake_module_functions.setdefault(fct_name, {})[
737-
PATH_MODULE
738-
] = module_attr
734+
self._fake_module_functions.setdefault(fct_name, {})["genericpath"] = (
735+
module_attr
736+
)
737+
self._fake_module_functions.setdefault(fct_name, {})[PATH_MODULE] = (
738+
module_attr
739+
)
739740

740741
def __enter__(self) -> "Patcher":
741742
"""Context manager for usage outside of

pyfakefs/fake_io.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
""" Uses :py:class:`FakeIoModule` to provide a
16-
fake ``io`` module replacement.
15+
"""Uses :py:class:`FakeIoModule` to provide a
16+
fake ``io`` module replacement.
1717
"""
18+
1819
import _io # pytype: disable=import-error
1920
import io
2021
import os

pyfakefs/fake_open.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
"""A fake open() function replacement. See ``fake_filesystem`` for usage.
16-
"""
15+
"""A fake open() function replacement. See ``fake_filesystem`` for usage."""
16+
1717
import errno
1818
import os
1919
import sys

pyfakefs/fake_os.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
""" Uses :py:class:`FakeOsModule` to provide a
16-
fake :py:mod:`os` module replacement.
15+
"""Uses :py:class:`FakeOsModule` to provide a
16+
fake :py:mod:`os` module replacement.
1717
"""
18+
1819
import errno
1920
import functools
2021
import inspect

pyfakefs/fake_path.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
""" Faked ``os.path`` module replacement. See ``fake_filesystem`` for usage.
16-
"""
15+
"""Faked ``os.path`` module replacement. See ``fake_filesystem`` for usage."""
16+
1717
import errno
1818
import os
1919
import sys
@@ -368,14 +368,12 @@ def samefile(self, path1: AnyStr, path2: AnyStr) -> bool:
368368
@overload
369369
def _join_real_path(
370370
self, path: str, rest: str, seen: Dict[str, Optional[str]]
371-
) -> Tuple[str, bool]:
372-
...
371+
) -> Tuple[str, bool]: ...
373372

374373
@overload
375374
def _join_real_path(
376375
self, path: bytes, rest: bytes, seen: Dict[bytes, Optional[bytes]]
377-
) -> Tuple[bytes, bool]:
378-
...
376+
) -> Tuple[bytes, bool]: ...
379377

380378
def _join_real_path(
381379
self, path: AnyStr, rest: AnyStr, seen: Dict[AnyStr, Optional[AnyStr]]

pyfakefs/fake_pathlib.py

+1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
(including PurePosixPath, PosixPath, PureWindowsPath and WindowsPath)
2929
get the properties of the underlying fake filesystem.
3030
"""
31+
3132
import errno
3233
import fnmatch
3334
import functools

pyfakefs/fake_scandir.py

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
and the standalone function available in the standalone `scandir` python
1717
package.
1818
"""
19+
1920
import os
2021
import sys
2122

pyfakefs/helpers.py

+6-10
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# limitations under the License.
1212

1313
"""Helper classes use for fake file system implementation."""
14+
1415
import io
1516
import locale
1617
import os
@@ -116,13 +117,11 @@ def get_locale_encoding():
116117

117118

118119
@overload
119-
def make_string_path(dir_name: AnyStr) -> AnyStr:
120-
...
120+
def make_string_path(dir_name: AnyStr) -> AnyStr: ...
121121

122122

123123
@overload
124-
def make_string_path(dir_name: os.PathLike) -> str:
125-
...
124+
def make_string_path(dir_name: os.PathLike) -> str: ...
126125

127126

128127
def make_string_path(dir_name: AnyPath) -> AnyStr: # type: ignore[type-var]
@@ -164,18 +163,15 @@ def now():
164163

165164

166165
@overload
167-
def matching_string(matched: bytes, string: AnyStr) -> bytes:
168-
...
166+
def matching_string(matched: bytes, string: AnyStr) -> bytes: ...
169167

170168

171169
@overload
172-
def matching_string(matched: str, string: AnyStr) -> str:
173-
...
170+
def matching_string(matched: str, string: AnyStr) -> str: ...
174171

175172

176173
@overload
177-
def matching_string(matched: AnyStr, string: None) -> None:
178-
...
174+
def matching_string(matched: AnyStr, string: None) -> None: ...
179175

180176

181177
def matching_string( # type: ignore[misc]

pyfakefs/patched_packages.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Provides patches for some commonly used modules that enable them to work
1515
with pyfakefs.
1616
"""
17+
1718
import sys
1819
from importlib import reload
1920

@@ -80,9 +81,9 @@ def reload_handler(name):
8081
def get_cleanup_handlers():
8182
handlers = {}
8283
if pd is not None:
83-
handlers[
84-
"pandas.core.arrays.arrow.extension_types"
85-
] = handle_extension_type_cleanup
84+
handlers["pandas.core.arrays.arrow.extension_types"] = (
85+
handle_extension_type_cleanup
86+
)
8687
if django is not None:
8788
for module_name in django_view_modules():
8889
handlers[module_name] = lambda name=module_name: reload_handler(name)

pyfakefs/pytest_tests/pytest_plugin_failing_helper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
""" Failing test to test stacktrace output - see
1+
"""Failing test to test stacktrace output - see
22
``pytest_check_failed_plugin_test.py``."""
33

44

pyfakefs/tests/dynamic_patch_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
"""
1414
Tests for patching modules loaded after `setUpPyfakefs()`.
1515
"""
16+
1617
import pathlib
1718
import unittest
1819

pyfakefs/tests/fake_filesystem_shutil_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
Note that almost all of the functionality is delegated to the real `shutil`
1818
and works correctly with the fake filesystem because of the faked `os` module.
1919
"""
20+
2021
import os
2122
import shutil
2223
import sys

pyfakefs/tests/fake_filesystem_unittest_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"""
1818
Test the :py:class`pyfakefs.fake_filesystem_unittest.TestCase` base class.
1919
"""
20+
2021
import glob
2122
import importlib.util
2223
import io

pyfakefs/tests/fake_stat_time_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
# limitations under the License.
1212

1313
"""Unit tests for file timestamp updates."""
14+
1415
import time
1516
import unittest
1617
from collections import namedtuple

pyfakefs/tests/fixtures/deprecated_property.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
over modules. The code is modeled after code in xmlbuilder.py in Python 3.6.
1515
See issue #542.
1616
"""
17+
1718
import warnings
1819

1920

pyfakefs/tests/import_as_example.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Example module that is used for testing modules that import file system modules
1515
to be patched under another name.
1616
"""
17+
1718
import os as my_os
1819
import pathlib
1920
import sys

pyfakefs/tests/mox3_stubout_example.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Example module that is used for testing the functionality of
1515
:py:class`pyfakefs.mox_stubout.StubOutForTesting`.
1616
"""
17+
1718
import datetime
1819
import math
1920
import os

pyfakefs/tests/patched_packages_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
Provides patches for some commonly used modules that enable them to work
1515
with pyfakefs.
1616
"""
17+
1718
import os
1819
import sys
1920
import unittest

pyfakefs/tests/performance_test.py

+1
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# See the License for the specific language governing permissions and
1111
# limitations under the License.
1212
"""Shall provide tests to check performance overhead of pyfakefs."""
13+
1314
import os
1415
import time
1516
import unittest

pyfakefs/tests/test_utils.py

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# Disable attribute errors - attributes not be found in mixin (shall be cleaned up...)
1616
# pytype: disable=attribute-error
1717
"""Common helper classes used in tests, or as test class base."""
18+
1819
import os
1920
import platform
2021
import shutil

0 commit comments

Comments
 (0)