Skip to content

Commit 5bc3abe

Browse files
Merge pull request #85428 from charles-zablit/charles-zablit/update-checkout/script-cleanup
[update-checkout] remove unused test and finalize `utf-8` encoding refactor
2 parents 7b02395 + e2c6b4a commit 5bc3abe

File tree

2 files changed

+2
-23
lines changed

2 files changed

+2
-23
lines changed

utils/update_checkout/tests/scheme_mock.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def __str__(self):
9494

9595
def call_quietly(*args, **kwargs):
9696
kwargs["stderr"] = subprocess.STDOUT
97+
kwargs["encoding"] = "utf-8"
9798
try:
9899
return subprocess.check_output(*args, **kwargs)
99100
except subprocess.CalledProcessError as e:

utils/update_checkout/tests/test_clone.py

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import os
1414

1515
from . import scheme_mock
16-
from unittest import mock
1716

1817

1918
class CloneTestCase(scheme_mock.SchemeMockTestCase):
@@ -55,28 +54,7 @@ def test_clone_with_additional_scheme(self):
5554
)
5655

5756
# Test that we're actually checking out the 'extra' scheme based on the output
58-
self.assertIn("git checkout refs/heads/main", output.decode("utf-8"))
59-
60-
def test_manager_not_called_on_long_socket(self):
61-
fake_tmpdir = "/tmp/very/" + "/long" * 20 + "/tmp"
62-
63-
with mock.patch("tempfile.gettempdir", return_value=fake_tmpdir), mock.patch(
64-
"multiprocessing.Manager"
65-
) as mock_manager:
66-
67-
self.call(
68-
[
69-
self.update_checkout_path,
70-
"--config",
71-
self.config_path,
72-
"--source-root",
73-
self.source_root,
74-
"--clone",
75-
]
76-
)
77-
# Ensure that we do not try to create a Manager when the tempdir
78-
# is too long.
79-
mock_manager.assert_not_called()
57+
self.assertIn("git checkout refs/heads/main", output)
8058

8159

8260
class SchemeWithMissingRepoTestCase(scheme_mock.SchemeMockTestCase):

0 commit comments

Comments
 (0)