Skip to content

Migrate lora pipeline tests to use pytest - #12426

Closed
sayakpaul wants to merge 32 commits into
mainfrom
migrate-lora-pytest
Closed

Migrate lora pipeline tests to use pytest#12426
sayakpaul wants to merge 32 commits into
mainfrom
migrate-lora-pytest

Conversation

@sayakpaul

@sayakpaul sayakpaul commented Oct 3, 2025

Copy link
Copy Markdown
Member

What does this PR do?

Migrates the LoRA pipeline tests (tests/lora/) to pure pytest because it has multiple advantages.

Summary of changes

  1. Use proper pytest fixtures wherever possible. This applies to tmpdirname, base_pipe_output, etc. This also helps in reducing LoC.
  2. Replace self.assert* methods with simpler asserts.
  3. Integration tests had setUp and tearDown methods. Those have been replaced with proper pytest fixtures as well.

Will let the CI decide if this is good to go. Will also run the integration tests, meanwhile and fix anything that comes on the way.

Edit: Ran the integration tests and they're good to go :)

def test_simple_inference_with_text_denoiser_lora_unfused(self):
super().test_simple_inference_with_text_denoiser_lora_unfused(expected_atol=9e-3)

def test_simple_inference_save_pretrained(self):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not testing any LoRA-related stuff. So, let's remove.

@sayakpaul
sayakpaul requested a review from DN6 October 3, 2025 15:42
@sayakpaul sayakpaul changed the title [wip] Migrate lora pipeline tests to use pytest Migrate lora pipeline tests to use pytest Oct 3, 2025
@sayakpaul
sayakpaul marked this pull request as ready for review October 3, 2025 15:42
@sayakpaul
sayakpaul requested a review from dg845 October 24, 2025 16:56
@sayakpaul

Copy link
Copy Markdown
Member Author

@DN6 a gentle ping 😅

@sayakpaul

Copy link
Copy Markdown
Member Author

I am going to close this PR in the interest of #12822. When the pipeline tests are refactored to follow what #12822 is doing, we will eventually club the tests from tests/lora.

@sayakpaul sayakpaul closed this Dec 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant