Skip to content

Commit aa00a71

Browse files
committed
try fix just tests
1 parent f2cafdc commit aa00a71

File tree

2 files changed

+38
-38
lines changed

2 files changed

+38
-38
lines changed

justfile

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -182,52 +182,73 @@ check: check-lint check-format check-types check-package check-docs check-docs-l
182182

183183
# run the tests that require rich not to be installed
184184
test-no-rich:
185-
@just run pip uninstall -y rich
186-
@just run pytest --cov-append -m no_rich
185+
uv pip uninstall rich
186+
uv run pytest --cov-append -m no_rich
187187

188188
# run the tests that require rich to be installed
189189
test-rich:
190-
@just run pytest --cov-append -m rich
191-
192-
# run all tests and log them
193-
log-tests:
194-
@just run python -m pytest --collect-only --disable-warnings -q --no-cov | @just run python -c "from pathlib import Path; import sys; Path('./tests/tests.log').unlink(missing_ok=True); open('./tests/tests.log', 'a').close(); open('./tests/all_tests.log', 'w').writelines(sys.stdin)"
190+
uv run pytest --cov-append -m rich
195191

196192
# run all tests
197193
test-all: test-rich test-no-rich
198-
@just run pip install colorama
199-
@just run pytest --cov-append -m "not rich and not no_rich"
200-
@just run pip uninstall -y colorama
201-
@just run pytest --cov-append -k test_ctor_params
194+
uv pip install colorama
195+
uv run pytest --cov-append -m "not rich and not no_rich"
196+
uv pip uninstall colorama
197+
uv run pytest --cov-append -k test_ctor_params
198+
199+
_log-tests:
200+
uv run pytest --collect-only --disable-warnings -q --no-cov
201+
202+
# run all tests and log them
203+
[script]
204+
log-tests:
205+
from pathlib import Path
206+
import sys
207+
Path('./tests/tests.log').unlink(missing_ok=True)
208+
open('./tests/tests.log', 'a').close()
209+
open('./tests/all_tests.log', 'w').writelines(sys.stdin)
202210

203211
# run the tests and report if any were not run - sanity check
212+
[script]
204213
list-missed-tests: install log-tests test-all
205-
@just run python ./tests/missed_tests.py
214+
import sys
215+
from pathlib import Path
216+
test_log = Path(__file__).parent / "tests.log"
217+
all_tests = Path(__file__).parent / "all_tests.log"
218+
assert test_log.is_file() and all_tests.is_file()
219+
220+
tests_run = set(test_log.read_text().splitlines())
221+
all_tests = set(all_tests.read_text().splitlines()[0:-2])
222+
if tests_run != all_tests:
223+
print("Not all tests were run:", file=sys.stderr)
224+
for test in all_tests - tests_run:
225+
print(test, file=sys.stderr)
226+
sys.exit(1)
206227

207228
# test bash shell completions
208229
[script("bash")]
209230
test-bash:
210-
@just run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_bash tests/test_parser_completers.py tests/shellcompletion/test_bash.py
231+
uv run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_bash tests/test_parser_completers.py tests/shellcompletion/test_bash.py
211232

212233
# test zsh shell completions
213234
[script("zsh")]
214235
test-zsh:
215-
@just run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_zsh tests/test_parser_completers.py tests/shellcompletion/test_zsh.py
236+
uv run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_zsh tests/test_parser_completers.py tests/shellcompletion/test_zsh.py
216237

217238
# test powershell shell completions
218239
[script("powershell")]
219240
test-powershell:
220-
@just run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_powershell tests/test_parser_completers.py tests/test_parser_completers.py tests/shellcompletion/test_powershell.py::PowerShellTests tests/shellcompletion/test_powershell.py::PowerShellExeTests
241+
uv run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_powershell tests/test_parser_completers.py tests/test_parser_completers.py tests/shellcompletion/test_powershell.py::PowerShellTests tests/shellcompletion/test_powershell.py::PowerShellExeTests
221242

222243
# test pwsh shell completions
223244
[script("pwsh")]
224245
test-pwsh:
225-
@just run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_pwsh tests/test_parser_completers.py tests/shellcompletion/test_powershell.py::PWSHTests tests/shellcompletion/test_powershell.py::PWSHExeTests
246+
uv run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_pwsh tests/test_parser_completers.py tests/shellcompletion/test_powershell.py::PWSHTests tests/shellcompletion/test_powershell.py::PWSHExeTests
226247

227248
# test fish shell completions
228249
[script("fish")]
229250
test-fish:
230-
@just run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_fish tests/test_parser_completers.py tests/shellcompletion/test_fish.py
251+
uv run pytest --cov-append tests/shellcompletion/test_shell_resolution.py::TestShellResolution::test_fish tests/test_parser_completers.py tests/shellcompletion/test_fish.py
231252

232253
# run tests
233254
test *TESTS:

tests/missed_tests.py

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)