unsloth/tests/python
Daniel Han 79b57fe038
studio: fix tests turning main CI red/flaky (kill-process, install overrides, UI re-login) (#6419)
* studio: set _stats_logger in kill-process test backend

#6377 added a self._stats_logger cleanup step to _kill_process's finally block.
test_kill_process_records_timestamp_on_actual_kill (added in #6400) builds the
backend via __new__, which bypasses __init__ where _stats_logger is set, so once
both landed on main the test raised AttributeError: 'LlamaCppBackend' object has
no attribute '_stats_logger'. Set _stats_logger on the hand-built backend,
mirroring __init__, so the kill path's finally has the attribute it expects.

* test: assert torchao override step on normal Linux, not overrides.txt

#6400 moved the torchao dependency override from a fixed pin in overrides.txt to
a torch-matched spec installed via --force-reinstall (_select_torchao_spec), and
turned overrides.txt into a comment-only pointer. It updated the Windows variant
(test_windows_only_includes_overrides) to check for --reinstall, but left
test_normal_linux_includes_overrides asserting overrides.txt is installed, which
no longer happens. Check for the override step (--reinstall) instead, matching
the Windows test.

* test(ui): tolerate ERR_ABORTED on /login re-login in shutdown step

The Shutdown step re-logs in after a CLI password rotation that revoked the prior
token. The SPA auth guard can client-side-redirect mid-navigation against the
stale token, aborting page.goto("/login") with net::ERR_ABORTED. It is a race
(passes on main most of the time). Resolve on domcontentloaded and tolerate the
abort, relying on the password-field wait that follows to confirm we reached
/login, matching the wait_until used by the other navigations in this file.
2026-06-17 22:30:30 -07:00
..
__init__.py Consolidate dual venvs and separate install from update (#4530) 2026-03-25 05:24:21 -07:00
conftest.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
test_construct_chat_template_validation.py fix(chat_templates): check find() return value before slicing on placeholders (#5763) 2026-05-25 06:19:01 -07:00
test_cross_platform_parity.py fix/uv-bytecode-timeout (#6166) 2026-06-12 02:37:51 -07:00
test_dpo_vision_processor_passthrough.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
test_e2e_no_torch_sandbox.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
test_fast_language_model_text_only.py feat: support text-only loading of Gemma 3 27B via FastLanguageModel (skip SiglipVisionModel) (#5816) 2026-06-09 22:52:39 -07:00
test_fast_model_config_passthrough.py Fix FastModel config passthrough for sequence classification (#6203) 2026-06-12 11:15:37 +03:00
test_fast_sentence_transformer_redirect_lifecycle.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
test_flash_attn_install_python_stack.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
test_gpu_init_ldconfig_guard.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
test_install_python_stack.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
test_no_torch_filtering.py studio: fix tests turning main CI red/flaky (kill-process, install overrides, UI re-login) (#6419) 2026-06-17 22:30:30 -07:00
test_orpo_processor_text_tokenizer.py Formatting: ruff line-length 100, kwarg-spacing passes, drop blank after short local imports (#6079) 2026-06-08 04:24:13 -07:00
test_patch_trl_rl_trainers_defensive.py Patch sibling config module so GRPOConfig resolves to the patched class (#5946) 2026-06-03 06:14:54 -07:00
test_studio_import_no_torch.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
test_tokenizers_and_torch_constraint.py Reduce and tighten code comments and docstrings repo-wide (#6095) 2026-06-08 23:09:51 -07:00
test_unsloth_run_tool_policy_resolver.py Studio: enable stdio MCP servers on a loopback bind (#6295) 2026-06-15 03:02:32 +01:00
test_vision_lora_targeting.py MLX Training updates (#5656) 2026-06-14 04:58:50 -07:00