Skip to content

Commit faaff3c

Browse files
committed
chore(ruff): Manual fixes for expand1, expand2 examples
1 parent 3d05c00 commit faaff3c

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

tests/fixtures/workspace/expand1.py

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
import pathlib
22

33
before_workspace = {
44
"session_name": "sample workspace",
@@ -33,7 +33,7 @@
3333
def after_workspace():
3434
return {
3535
"session_name": "sample workspace",
36-
"start_directory": os.path.expanduser("~"),
36+
"start_directory": str(pathlib.Path().home()),
3737
"windows": [
3838
{
3939
"window_name": "editor",
@@ -57,21 +57,15 @@ def after_workspace():
5757
],
5858
},
5959
{
60-
"start_directory": os.path.normpath(
61-
os.path.join(os.path.expanduser("~"), "./")
62-
),
60+
"start_directory": str(pathlib.Path().home()),
6361
"panes": [{"shell_command": [{"cmd": "pwd"}]}],
6462
},
6563
{
66-
"start_directory": os.path.normpath(
67-
os.path.join(os.path.expanduser("~"), "./asdf")
68-
),
64+
"start_directory": str(pathlib.Path().home() / "asdf"),
6965
"panes": [{"shell_command": [{"cmd": "pwd"}]}],
7066
},
7167
{
72-
"start_directory": os.path.normpath(
73-
os.path.join(os.path.expanduser("~"), "../")
74-
),
68+
"start_directory": str(pathlib.Path().home().parent.resolve()),
7569
"panes": [{"shell_command": [{"cmd": "pwd"}]}],
7670
},
7771
{"panes": [{"shell_command": [{"cmd": "top"}]}]},

tests/fixtures/workspace/expand2.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import os
1+
import pathlib
22

33
from .. import utils as test_utils
44

@@ -9,5 +9,5 @@ def unexpanded_yaml():
99

1010
def expanded_yaml():
1111
return test_utils.read_workspace_file("workspace/expand2-expanded.yaml").format(
12-
HOME=os.path.expanduser("~")
12+
HOME=str(pathlib.Path().home())
1313
)

0 commit comments

Comments
 (0)