Skip to content

Commit b09c2b1

Browse files
committed
try fix windows tests
1 parent c168576 commit b09c2b1

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

justfile

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@ default:
1313
manage *COMMAND:
1414
import os
1515
import sys
16+
import shlex
1617
from pathlib import Path
1718
from django.core import management
1819
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.settings.base")
19-
management.execute_from_command_line(sys.argv + "{{ COMMAND }}".split(" "))
20+
management.execute_from_command_line(sys.argv + shlex.split('{{ COMMAND }}'))
2021

2122
# install the uv package manager
2223
[linux]
@@ -94,7 +95,7 @@ clean-git-ignored:
9495
git clean -fdX
9596

9697
# remove all non repository artifacts
97-
clean: clean-docs clean-env clean-git-ignored
98+
clean: clean-docs clean-git-ignored clean-env
9899

99100
# build html documentation
100101
build-docs-html: install-docs

tests/shellcompletion/test_powershell.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,12 @@ def verify_remove(self, script=None):
5858
def test_mixed_path_dividers(self):
5959
self.install()
6060
self.verify_install()
61+
completions = self.get_completions(
62+
"completion", "--path", "./src/django_typer\\comp"
63+
)
6164
self.assertIn(
62-
"src/django_typer\\completers",
63-
self.get_completions("completion", "--path", "./src/django_typer\\comp"),
65+
"src\\django_typer\\completers",
66+
completions,
6467
)
6568
self.remove()
6669
self.verify_remove()
@@ -156,7 +159,7 @@ def test_mixed_path_dividers(self):
156159
self.install()
157160
self.verify_install()
158161
self.assertIn(
159-
"src/django_typer\\completers",
162+
"src\\django_typer\\completers",
160163
self.get_completions("completion", "--path", "./src/django_typer\\comp"),
161164
)
162165
self.remove()

tests/test_parser_completers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1821,7 +1821,7 @@ def test_pythonpath_completer(self):
18211821
for f in os.listdir("./src/django_typer")
18221822
if not (Path("./src/django_typer") / f).is_dir()
18231823
]
1824-
result = self.shellcompletion.complete("multi --pythonpath src/dj")
1824+
result = self.shellcompletion.complete(f"multi --pythonpath src{os.path.sep}dj")
18251825
for pth in local_dirs:
18261826
self.assertIn(pth.replace("/", os.path.sep), result)
18271827
for pth in local_files:
@@ -1905,7 +1905,7 @@ def test_path_completer(self):
19051905
for d in os.listdir("src/django_typer")
19061906
if (Path("src/django_typer") / d).is_dir()
19071907
]
1908-
result = self.shellcompletion.complete("completion --path src/dj")
1908+
result = self.shellcompletion.complete(f"completion --path src{os.path.sep}dj")
19091909
for pth in local_paths:
19101910
self.assertIn(str(pth).replace("/", os.path.sep), result)
19111911

0 commit comments

Comments
 (0)