Skip to content

Commit 5244a97

Browse files
committed
Normalise paths in tests.
1 parent 205588f commit 5244a97

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

tests/test_notebook2script.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# stdlib
22
import pathlib
33
import re
4+
from os.path import normpath
45
from textwrap import dedent
56

67
# 3rd party
@@ -93,12 +94,12 @@ def test_cli(tmp_pathplus):
9394
result: Result = runner.invoke(
9495
main,
9596
catch_exceptions=False,
96-
args=[str(tests_dir / "example_notebook.ipynb"), "--outdir", str(outdir)],
97+
args=[normpath(tests_dir / "example_notebook.ipynb"), "--outdir", normpath(outdir)],
9798
)
9899
assert result.exit_code == 0
99100
assert result.stdout == dedent(
100101
f"""\
101-
Converting {tests_dir}/example_notebook.ipynb to {tmp_pathplus}/output/example_notebook.py
102+
Converting {normpath(tests_dir)}/example_notebook.ipynb to {normpath(tmp_pathplus)}/output/example_notebook.py
102103
"""
103104
)
104105

@@ -113,12 +114,12 @@ def test_cli_glob(tmp_pathplus):
113114
result: Result = runner.invoke(
114115
main,
115116
catch_exceptions=False,
116-
args=[str(tests_dir / "*.ipynb"), "--outdir", str(outdir)],
117+
args=[normpath(tests_dir / "*.ipynb"), "--outdir", normpath(outdir)],
117118
)
118119
assert result.exit_code == 0
119120
assert result.stdout == dedent(
120121
f"""\
121-
Converting {tests_dir}/example_notebook.ipynb to {tmp_pathplus}/output/example_notebook.py
122+
Converting {normpath(tests_dir)}/example_notebook.ipynb to {normpath(tmp_pathplus)}/output/example_notebook.py
122123
"""
123124
)
124125

0 commit comments

Comments
 (0)