mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-25 22:37:12 +00:00
Decode Cargo metadata as UTF-8 on Windows
This commit is contained in:
@@ -31,7 +31,7 @@ def workspace_names(metadata):
|
||||
def check_workspace():
|
||||
result = subprocess.run(
|
||||
["cargo", "metadata", "--no-deps", "--offline", "--locked", "--format-version", "1"],
|
||||
cwd=ROOT, check=True, stdout=subprocess.PIPE, text=True,
|
||||
cwd=ROOT, check=True, stdout=subprocess.PIPE, text=True, encoding="utf-8",
|
||||
)
|
||||
names = workspace_names(json.loads(result.stdout))
|
||||
# From this virtual workspace root, cargo fmt normally checks all workspace packages.
|
||||
|
||||
@@ -179,6 +179,7 @@ class PackageFormatting(unittest.TestCase):
|
||||
["cargo", "fmt", "--check", "--package", "craft-a"],
|
||||
["cargo", "fmt", "--check", "--package", "craft-b"],
|
||||
])
|
||||
self.assertEqual(execute.call_args_list[0].kwargs["encoding"], "utf-8")
|
||||
for call in execute.call_args_list:
|
||||
self.assertEqual(call.kwargs["cwd"], ROOT)
|
||||
self.assertTrue(call.kwargs["check"])
|
||||
|
||||
Reference in New Issue
Block a user