Skip to content

Commit 2a325be

Browse files
committed
Updates for Formate 1.2
1 parent 62dc6ea commit 2a325be

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

tests/test_formate_plugin.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,23 +116,22 @@ def test_source_is_formatted(self, filename: str) -> None:
116116
def check_file(self, filename: str, mode: black.Mode, kwargs: dict, *, data: bool = True) -> None:
117117
source, expected = read_data(filename, data=data)
118118

119-
result: Result
120-
121119
with TemporaryPathPlus() as tmp_pathplus:
122-
(tmp_pathplus / filename).write_text(source)
120+
python_file = (tmp_pathplus / filename).with_suffix(".py")
121+
python_file.write_text(source)
123122
toml_data = dom_toml.load(PathPlus(__file__).parent / "example_formate.toml")
124123
toml_data["hooks"]["black"]["kwargs"] = kwargs
125124
dom_toml.dump(toml_data, tmp_pathplus / "formate.toml")
126125

127126
with in_directory(tmp_pathplus):
128127
runner = CliRunner(mix_stderr=False)
129-
result = runner.invoke(
128+
result: Result = runner.invoke(
130129
main,
131-
args=[filename, "--no-colour", "--diff", "--verbose", "-v"],
130+
args=[python_file.name, "--no-colour", "--diff", "--verbose", "-v"],
132131
)
133132

134133
# TODO: check stdout
135-
actual = (tmp_pathplus / filename).read_text()
134+
actual = python_file.read_text()
136135

137136
self.assertFormatEqual(expected, actual)
138137
if source != actual:

0 commit comments

Comments
 (0)