Skip to content

Commit 815e8be

Browse files
committed
format
1 parent b5b11c7 commit 815e8be

2 files changed

Lines changed: 5 additions & 13 deletions

File tree

python/runfiles/runfiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ def rglob(self, pattern: str) -> Generator["Self", None, None]:
354354
yield self / p.relative_to(resolved)
355355

356356
def __repr__(self) -> str:
357-
return 'runfiles.Path({!r})'.format(self.runfile_path)
357+
return "runfiles.Path({!r})".format(self.runfile_path)
358358

359359
def __str__(self) -> str:
360360
path_posix = super().__str__().replace("\\", "/")

tests/runfiles/pathlib_test.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88

99
class PathlibTest(unittest.TestCase):
1010
def setUp(self) -> None:
11-
self.tmpdir = tempfile.TemporaryDirectory(
12-
dir=os.environ.get("TEST_TMPDIR")
13-
)
11+
self.tmpdir = tempfile.TemporaryDirectory(dir=os.environ.get("TEST_TMPDIR"))
1412
# Runfiles paths are expected to be posix paths internally when we
1513
# construct the strings for assertions
1614
self.root_path = pathlib.Path(self.tmpdir.name).resolve()
@@ -23,9 +21,7 @@ def setUp(self) -> None:
2321
self.test_file.write_text("hello runfiles", encoding="utf-8")
2422
self.sub_dir = self.repo_dir / "subdir"
2523
self.sub_dir.mkdir()
26-
(self.sub_dir / "other.txt").write_text(
27-
"other content", encoding="utf-8"
28-
)
24+
(self.sub_dir / "other.txt").write_text("other content", encoding="utf-8")
2925

3026
def _create_runfiles(self) -> runfiles.Runfiles:
3127
r = runfiles.Create({"RUNFILES_DIR": self.root_dir})
@@ -101,12 +97,8 @@ def test_parents(self) -> None:
10197
def test_with_methods(self) -> None:
10298
r = self._create_runfiles()
10399
p = r.root() / "foo/bar.txt"
104-
self.assertEqual(
105-
str(p.with_name("baz.py")), f"{self.root_dir}/foo/baz.py"
106-
)
107-
self.assertEqual(
108-
str(p.with_suffix(".dat")), f"{self.root_dir}/foo/bar.dat"
109-
)
100+
self.assertEqual(str(p.with_name("baz.py")), f"{self.root_dir}/foo/baz.py")
101+
self.assertEqual(str(p.with_suffix(".dat")), f"{self.root_dir}/foo/bar.dat")
110102

111103
def test_match(self) -> None:
112104
r = self._create_runfiles()

0 commit comments

Comments
 (0)