Skip to content

Commit aac641d

Browse files
committed
chore(tests): Simplify stubbing file
1 parent 39a4315 commit aac641d

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

tests/test_cli.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@ def test_in_dir_from_config_dir(tmp_path: pathlib.Path):
4343

4444
cli.startup(tmp_path)
4545
yaml_config = tmp_path / "myconfig.yaml"
46-
yaml_config.write_text("", encoding="utf-8")
46+
yaml_config.touch()
4747
json_config = tmp_path / "myconfig.json"
48-
json_config.write_text("", encoding="utf-8")
48+
json_config.touch()
4949
configs_found = config.in_dir(tmp_path)
5050

5151
assert len(configs_found) == 2
@@ -57,9 +57,9 @@ def test_ignore_non_configs_from_current_dir(tmp_path: pathlib.Path):
5757
cli.startup(tmp_path)
5858

5959
junk_config = tmp_path / "myconfig.psd"
60-
junk_config.write_text("", encoding="utf-8")
60+
junk_config.touch()
6161
conf = tmp_path / "watmyconfig.json"
62-
conf.write_text("", encoding="utf-8")
62+
conf.touch()
6363
configs_found = config.in_dir(tmp_path)
6464
assert len(configs_found) == 1
6565

@@ -164,10 +164,10 @@ def test_resolve_dot(
164164
monkeypatch.setenv("XDG_CONFIG_HOME", str(homedir / ".config"))
165165

166166
tmuxp_conf_path = projectdir / ".tmuxp.yaml"
167-
tmuxp_conf_path.write_text("", encoding="utf-8")
167+
tmuxp_conf_path.touch()
168168
user_config_name = "myconfig"
169169
user_config = configdir / f"{user_config_name}.yaml"
170-
user_config.write_text("", encoding="utf-8")
170+
user_config.touch()
171171

172172
project_config = tmuxp_conf_path
173173

@@ -272,10 +272,10 @@ def config_cmd(config):
272272

273273
monkeypatch.setenv("HOME", str(homedir))
274274
tmuxp_config_path = projectdir / ".tmuxp.yaml"
275-
tmuxp_config_path.write_text("", encoding="utf-8")
275+
tmuxp_config_path.touch()
276276
user_config_name = "myconfig"
277277
user_config = configdir / f"{user_config_name}.yaml"
278-
user_config.write_text("", encoding="utf-8")
278+
user_config.touch()
279279

280280
project_config = projectdir / ".tmuxp.yaml"
281281

@@ -422,7 +422,7 @@ def test_regression_00132_session_name_with_dots(
422422
def test_load_zsh_autotitle_warning(cli_args, tmp_path, monkeypatch):
423423
# create dummy tmuxp yaml so we don't get yelled at
424424
yaml_config = tmp_path / ".tmuxp.yaml"
425-
yaml_config.write_text("", encoding="utf-8")
425+
yaml_config.touch()
426426
oh_my_zsh_path = tmp_path / ".oh-my-zsh"
427427
oh_my_zsh_path.mkdir()
428428
monkeypatch.setenv("HOME", str(tmp_path))
@@ -870,7 +870,7 @@ def test_import_teamocil(cli_args, inputs, tmp_path, monkeypatch):
870870
teamocil_config_path.write_text(teamocil_config, encoding="utf-8")
871871

872872
exists_yaml = tmp_path / "exists.yaml"
873-
exists_yaml.write_text("", encoding="utf-8")
873+
exists_yaml.touch()
874874

875875
monkeypatch.setenv("HOME", str(tmp_path))
876876

@@ -909,7 +909,7 @@ def test_import_tmuxinator(cli_args, inputs, tmp_path, monkeypatch):
909909
tmuxinator_config_path.write_text(tmuxinator_config, encoding="utf-8")
910910

911911
exists_yaml = tmp_path / "exists.yaml"
912-
exists_yaml.write_text("", encoding="utf-8")
912+
exists_yaml.touch()
913913

914914
monkeypatch.setenv("HOME", str(tmp_path))
915915

@@ -939,7 +939,7 @@ def test_import_tmuxinator(cli_args, inputs, tmp_path, monkeypatch):
939939
def test_freeze(server, cli_args, inputs, tmp_path, monkeypatch):
940940
monkeypatch.setenv("HOME", str(tmp_path))
941941
exists_yaml = tmp_path / "exists.yaml"
942-
exists_yaml.write_text("", encoding="utf-8")
942+
exists_yaml.touch()
943943

944944
server.new_session(session_name="myfirstsession")
945945
server.new_session(session_name="myfrozensession")
@@ -983,7 +983,7 @@ def test_freeze(server, cli_args, inputs, tmp_path, monkeypatch):
983983
def test_freeze_overwrite(server, cli_args, inputs, tmp_path, monkeypatch):
984984
monkeypatch.setenv("HOME", str(tmp_path))
985985
exists_yaml = tmp_path / "exists.yaml"
986-
exists_yaml.write_text("", encoding="utf-8")
986+
exists_yaml.touch()
987987

988988
server.new_session(session_name="mysession")
989989

0 commit comments

Comments
 (0)