Skip to content

Commit b674065

Browse files
committed
fix rich completion tests on windows
1 parent 10413b3 commit b674065

File tree

3 files changed

+42
-33
lines changed

3 files changed

+42
-33
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
django-version:
2828
- '3.2' # LTS April 2024
2929
- '4.2' # LTS April 2026
30-
- '5.1' # December 2025
30+
- '5.2' # December 2025
3131
exclude:
3232
- python-version: '3.9'
3333
django-version: '4.2'
@@ -38,9 +38,9 @@ jobs:
3838
- python-version: '3.10'
3939
django-version: '3.2'
4040
- python-version: '3.9'
41-
django-version: '5.1'
41+
django-version: '5.2'
4242
- python-version: '3.10'
43-
django-version: '5.1'
43+
django-version: '5.2'
4444

4545
env:
4646
TEST_PYTHON_VERSION: ${{ matrix.python-version }}

.github/workflows/test.yml

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
- '4.2' # LTS April 2026
3737
- '5.0' # April 2025
3838
- '5.1' # December 2025
39-
- '5.2rc1'
39+
- '5.2' # April 2028
4040
exclude:
4141
- python-version: '3.9'
4242
django-version: '5.0'
@@ -53,7 +53,7 @@ jobs:
5353
- python-version: '3.13'
5454
django-version: '5.0'
5555
- python-version: '3.9'
56-
django-version: '5.2rc1'
56+
django-version: '5.2'
5757
env:
5858
COVERAGE_FILE: py${{ matrix.python-version }}-linux-dj${{ matrix.django-version }}.coverage
5959
TEST_PYTHON_VERSION: ${{ matrix.python-version }}
@@ -85,11 +85,7 @@ jobs:
8585
uses: extractions/setup-just@v3
8686
- name: Install Dependencies
8787
run: |
88-
if [ "${{ matrix.django-version }}" = "5.2rc1" ]; then
89-
just test-lock "Django==${{ matrix.django-version }}"
90-
else
91-
just test-lock "Django~=${{ matrix.django-version }}.0"
92-
fi
88+
just test-lock "Django~=${{ matrix.django-version }}.0"
9389
- name: Run Unit Tests
9490
run: |
9591
just test ./tests/verify_environment.py
@@ -112,10 +108,10 @@ jobs:
112108
python-version: ['3.9', '3.13']
113109
django-version:
114110
- '3.2' # LTS April 2024
115-
- '5.1' # December 2025
111+
- '5.2' # April 2028
116112
exclude:
117113
- python-version: '3.9'
118-
django-version: '5.1'
114+
django-version: '5.2'
119115
- python-version: '3.13'
120116
django-version: '3.2'
121117

@@ -170,10 +166,10 @@ jobs:
170166
python-version: ['3.9', '3.13']
171167
django-version:
172168
- '3.2' # LTS April 2024
173-
- '5.1' # December 2025
169+
- '5.2' # LTS April 2028
174170
exclude:
175171
- python-version: '3.9'
176-
django-version: '5.1'
172+
django-version: '5.2'
177173
- python-version: '3.13'
178174
django-version: '3.2'
179175

@@ -240,7 +236,7 @@ jobs:
240236
python-version: ['3.13']
241237
postgres-version: ['latest']
242238
django-version:
243-
- '5.1' # December 2025
239+
- '5.2' # April 2028
244240

245241
# Service containers to run with `runner-job`
246242
services:
@@ -309,10 +305,10 @@ jobs:
309305
python-version: ['3.9', '3.13']
310306
django-version:
311307
- '3.2' # LTS April 2024
312-
- '5.1' # December 2025
308+
- '5.2' # April 2028
313309
exclude:
314310
- python-version: '3.9'
315-
django-version: '5.1'
311+
django-version: '5.2'
316312
- python-version: '3.13'
317313
django-version: '3.2'
318314
env:
@@ -371,10 +367,10 @@ jobs:
371367
python-version: ['3.9', '3.13']
372368
django-version:
373369
- '3.2' # LTS April 2024
374-
- '5.1' # December 2025
370+
- '5.2' # April 2028
375371
exclude:
376372
- python-version: '3.9'
377-
django-version: '5.1'
373+
django-version: '5.2'
378374
- python-version: '3.13'
379375
django-version: '3.2'
380376
env:
@@ -435,10 +431,10 @@ jobs:
435431
python-version: ['3.9', '3.13']
436432
django-version:
437433
- '3.2' # LTS April 2024
438-
- '5.1' # December 2025
434+
- '5.2' # April 2028
439435
exclude:
440436
- python-version: '3.9'
441-
django-version: '5.1'
437+
django-version: '5.2'
442438
- python-version: '3.13'
443439
django-version: '3.2'
444440

@@ -506,10 +502,10 @@ jobs:
506502
python-version: ['3.9', '3.13']
507503
django-version:
508504
- '3.2' # LTS April 2024
509-
- '5.1' # December 2025
505+
- '5.2' # April 2028
510506
exclude:
511507
- python-version: '3.9'
512-
django-version: '5.1'
508+
django-version: '5.2'
513509
- python-version: '3.13'
514510
django-version: '3.2'
515511

@@ -567,10 +563,10 @@ jobs:
567563
python-version: ['3.9', '3.13']
568564
django-version:
569565
- '3.2' # LTS April 2024
570-
- '5.1' # December 2025
566+
- '5.2' # April 2028
571567
exclude:
572568
- python-version: '3.9'
573-
django-version: '5.1'
569+
django-version: '5.2'
574570
- python-version: '3.13'
575571
django-version: '3.2'
576572

tests/shellcompletion/__init__.py

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -280,14 +280,26 @@ def run_rich_option_completion(self, rich_output_expected: bool):
280280
self.assertIn("--cmd-first", completions)
281281
self.assertIn("--cmd-dup", completions)
282282
if not rich_installed:
283-
self.assertIn("[bold]", completions)
284-
self.assertIn("[/bold]", completions)
285-
self.assertIn("[reverse]", completions)
286-
self.assertIn("[/reverse]", completions)
287-
self.assertIn("[underline]", completions)
288-
self.assertIn("[/underline]", completions)
289-
self.assertIn("[yellow]", completions)
290-
self.assertIn("[/yellow]", completions)
283+
if self.shell not in ["powershell", "pwsh"]:
284+
self.assertIn("[bold]", completions)
285+
self.assertIn("[/bold]", completions)
286+
self.assertIn("[reverse]", completions)
287+
self.assertIn("[/reverse]", completions)
288+
self.assertIn("[underline]", completions)
289+
self.assertIn("[/underline]", completions)
290+
self.assertIn("[yellow]", completions)
291+
self.assertIn("[/yellow]", completions)
292+
else:
293+
self.assertTrue(
294+
"[bold]" in completions
295+
or "[/bold]" in completions
296+
or "[reverse]" in completions
297+
or "[/reverse]" in completions
298+
or "[underline]" in completions
299+
or "[/underline]" in completions
300+
or "[yellow]" in completions
301+
or "[/yellow]" in completions
302+
)
291303
elif rich_output_expected:
292304
# \x1b[0m and \x1b[m are the same
293305
if self.shell not in ["powershell", "pwsh"]:
@@ -562,6 +574,7 @@ def wait_for_output(child) -> t.Tuple[int, t.Optional[str]]:
562574

563575
self.verify_install(directory=directory)
564576

577+
# TODO
565578
# else:
566579

567580
# def test_prompt_install(self, env={}, directory: t.Optional[Path] = None):

0 commit comments

Comments
 (0)