Skip to content

Commit 56d5744

Browse files
committed
ci: fix ci fail
1 parent 720eb68 commit 56d5744

File tree

6 files changed

+23
-13
lines changed

6 files changed

+23
-13
lines changed

.github/workflows/ci-test-reproducibility.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ jobs:
6262
fi
6363
6464
- name: Check test case count
65-
run: poetry run python .templates/check_test_cases.py --threshold=10 --max=100
65+
run: poetry run python -m leetcode_py.tools.check_test_cases --threshold=10 --max=none
6666

6767
- name: Backup existing problems
6868
run: |

.github/workflows/ci-test.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ jobs:
3333
key: venv-${{ runner.os }}-${{ steps.setup-python.outputs.python-version }}-${{ hashFiles('**/poetry.lock') }}
3434

3535
- name: Install dependencies
36-
run: poetry install --no-interaction --no-ansi
36+
run: |
37+
poetry install --no-interaction --no-ansi
38+
poetry run pip install -e .
3739
3840
- name: Cache Graphviz installation
3941
id: cache-graphviz

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ If you need more problems beyond Grind 75, use an LLM assistant in your IDE (Cur
168168
**Manual Check**: Find problems needing more test cases:
169169

170170
```bash
171-
poetry run python .templates/check_test_cases.py --threshold=10
171+
poetry run python -m leetcode_py.tools.check_test_cases --threshold=10
172172
```
173173

174174
## 🧰 Helper Classes

tests/cli/test_gen.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import re
12
import tempfile
23
from pathlib import Path
34

@@ -12,11 +13,13 @@
1213
def test_gen_help():
1314
result = runner.invoke(app, ["gen", "--help"])
1415
assert result.exit_code == 0
15-
assert "--problem-num" in result.stdout
16-
assert "--problem-slug" in result.stdout
17-
assert "--problem-tag" in result.stdout
18-
assert "--difficulty" in result.stdout
19-
assert "--all" in result.stdout
16+
# Remove ANSI color codes for reliable string matching
17+
clean_output = re.sub(r"\x1b\[[0-9;]*m", "", result.stdout)
18+
assert "--problem-num" in clean_output
19+
assert "--problem-slug" in clean_output
20+
assert "--problem-tag" in clean_output
21+
assert "--difficulty" in clean_output
22+
assert "--all" in clean_output
2023

2124

2225
def test_gen_no_options():

tests/cli/test_list.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Tests for list command."""
1+
import re
22

33
from typer.testing import CliRunner
44

@@ -10,8 +10,10 @@
1010
def test_list_help():
1111
result = runner.invoke(app, ["list", "--help"])
1212
assert result.exit_code == 0
13-
assert "--tag" in result.stdout
14-
assert "--difficulty" in result.stdout
13+
# Remove ANSI color codes for reliable string matching
14+
clean_output = re.sub(r"\x1b\[[0-9;]*m", "", result.stdout)
15+
assert "--tag" in clean_output
16+
assert "--difficulty" in clean_output
1517

1618

1719
def test_list_all_problems():

tests/cli/test_scrape.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import re
23

34
import pytest
45
from typer.testing import CliRunner
@@ -11,8 +12,10 @@
1112
def test_scrape_help():
1213
result = runner.invoke(app, ["scrape", "--help"])
1314
assert result.exit_code == 0
14-
assert "--problem-num" in result.stdout
15-
assert "--problem-slug" in result.stdout
15+
# Remove ANSI color codes for reliable string matching
16+
clean_output = re.sub(r"\x1b\[[0-9;]*m", "", result.stdout)
17+
assert "--problem-num" in clean_output
18+
assert "--problem-slug" in clean_output
1619

1720

1821
def test_scrape_no_options():

0 commit comments

Comments
 (0)