diff --git a/tests/slow/test_grpo_slow.py b/tests/slow/test_grpo_slow.py index c61a3bdb217..7ba974423ca 100644 --- a/tests/slow/test_grpo_slow.py +++ b/tests/slow/test_grpo_slow.py @@ -329,11 +329,11 @@ def reward_func(prompts, completions, **kwargs): assert lora_params_changed, "No LoRA parameters were updated during training." except torch.OutOfMemoryError as e: - self.skipTest(f"Skipping VLM training test due to insufficient GPU memory: {e}") + pytest.skip(f"Skipping VLM training test due to insufficient GPU memory: {e}") except Exception as e: # Check for other memory-related errors if any(keyword in str(e).lower() for keyword in ["memory", "cuda", "out of memory", "insufficient"]): - self.skipTest(f"Skipping VLM training test due to hardware constraints: {e}") + pytest.skip(f"Skipping VLM training test due to hardware constraints: {e}") else: raise @@ -474,11 +474,11 @@ def dummy_reward_func(completions, **kwargs): "decrease gpu memory", ] ): - self.skipTest(f"Skipping vLLM colocate test due to hardware constraints: {e}") + pytest.skip(f"Skipping vLLM colocate test due to hardware constraints: {e}") elif "KeyError" in str(e) and "RANK" in str(e): - self.skipTest(f"Skipping vLLM colocate test due to environment setup issues: {e}") + pytest.skip(f"Skipping vLLM colocate test due to environment setup issues: {e}") elif "ValueError" in str(e) and "memory" in str(e).lower(): - self.skipTest(f"Skipping vLLM colocate test due to memory constraints: {e}") + pytest.skip(f"Skipping vLLM colocate test due to memory constraints: {e}") else: raise finally: @@ -541,11 +541,11 @@ def test_training_vllm(self): "decrease gpu memory", ] ): - self.skipTest(f"Skipping vLLM training test due to hardware constraints: {e}") + pytest.skip(f"Skipping vLLM training test due to hardware constraints: {e}") elif "KeyError" in str(e) and "RANK" in str(e): - self.skipTest(f"Skipping vLLM training test due to environment setup issues: {e}") + pytest.skip(f"Skipping vLLM training test due to environment setup issues: {e}") elif "ValueError" in str(e) and "memory" in str(e).lower(): - self.skipTest(f"Skipping vLLM training test due to memory constraints: {e}") + pytest.skip(f"Skipping vLLM training test due to memory constraints: {e}") else: raise diff --git a/tests/test_gkd_trainer.py b/tests/test_gkd_trainer.py index b311ce2b0b6..27d3c8ff3ba 100644 --- a/tests/test_gkd_trainer.py +++ b/tests/test_gkd_trainer.py @@ -259,7 +259,7 @@ def test_gkd_trainer_with_liger(self): # Ensure liger fused JSD path is enabled; if not, skip (runtime may lack system libs) if not getattr(trainer, "use_liger_gkd_loss", False): - self.skipTest("Liger fused JSD not enabled at runtime; skipping fused-loss assertion") + pytest.skip("Liger fused JSD not enabled at runtime; skipping fused-loss assertion") trainer.train()