[PR #446] Fix test helper discovery in pytest and sanitizer runner #452

Open
opened 2026-10-26 21:18:00 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/446
Author: @lucifer1004
Created: 9/14/2026
Status: 🔄 Open

Base: main ← Head: fix/test-helper-discovery


📝 Commits (2)

  • 4068492 fix(testing): respect test discovery opt-out markers
  • 5b1f8e5 test: keep discovery fix focused on pytest convention

📊 Changes

2 files changed (+4 additions, -1 deletions)

View changed files

📝 deep_gemm/testing/utils.py (+3 -0)
📝 tests/test_sanitizer.py (+1 -1)

📄 Description

Summary

  • Mark the test_filter decorator factory with pytest's existing __test__ = False opt-out convention.
  • Make the sanitizer runner respect the same marker instead of excluding names containing test_filter.

Why

Running an entire test module through pytest can collect the imported test_filter(condition) helper and fail with fixture 'condition' not found. Direct script execution avoids this, while the sanitizer runner currently has a name-specific exclusion. The shared marker handles aliases and explicit opt-outs without accidentally excluding real tests such as test_filter_behavior.

The marker applies only to the decorator factory. Decorated test functions remain discoverable, and existing condition-based execution/filtering behavior is unchanged.

Validation

Used a temporary CPU-only verification harness (not included in this PR):

  • Actual pytest collection/execution and default sanitizer discovery checks: 2 passed with the fix; 2 failed as expected against unmodified upstream 78b6900.
  • Confirmed the sanitizer-generated Python payloads execute successfully and temporary mocks restore original functions.
  • Confirmed pytest's collection hook checks getattr(obj, "__test__", True) directly.
  • git diff --check: passed.

No GPU kernels, actual Compute Sanitizer execution, or native rebuild were required. This small PR is independent of the SM120/API migration work.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/deepseek-ai/DeepGEMM/pull/446 **Author:** [@lucifer1004](https://github.com/lucifer1004) **Created:** 9/14/2026 **Status:** 🔄 Open **Base:** `main` ← **Head:** `fix/test-helper-discovery` --- ### 📝 Commits (2) - [`4068492`](https://github.com/deepseek-ai/DeepGEMM/commit/4068492b8ee4045a70508da287e58f9eea710d15) fix(testing): respect test discovery opt-out markers - [`5b1f8e5`](https://github.com/deepseek-ai/DeepGEMM/commit/5b1f8e53afc73bd6cc81e129c92866360ef29034) test: keep discovery fix focused on pytest convention ### 📊 Changes **2 files changed** (+4 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `deep_gemm/testing/utils.py` (+3 -0) 📝 `tests/test_sanitizer.py` (+1 -1) </details> ### 📄 Description ## Summary - Mark the `test_filter` decorator factory with pytest's existing `__test__ = False` opt-out convention. - Make the sanitizer runner respect the same marker instead of excluding names containing `test_filter`. ## Why Running an entire test module through pytest can collect the imported `test_filter(condition)` helper and fail with `fixture 'condition' not found`. Direct script execution avoids this, while the sanitizer runner currently has a name-specific exclusion. The shared marker handles aliases and explicit opt-outs without accidentally excluding real tests such as `test_filter_behavior`. The marker applies only to the decorator factory. Decorated test functions remain discoverable, and existing condition-based execution/filtering behavior is unchanged. ## Validation Used a temporary CPU-only verification harness (not included in this PR): - Actual pytest collection/execution and default sanitizer discovery checks: **2 passed** with the fix; **2 failed as expected** against unmodified upstream `78b6900`. - Confirmed the sanitizer-generated Python payloads execute successfully and temporary mocks restore original functions. - Confirmed pytest's collection hook checks `getattr(obj, "__test__", True)` directly. - `git diff --check`: passed. No GPU kernels, actual Compute Sanitizer execution, or native rebuild were required. This small PR is independent of the SM120/API migration work. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
deepseek-ai/DeepGEMM#452
No description provided.