[PR #266] [CLOSED] Add pytest fixtures in conftest.py #328

Closed
opened 2026-10-26 21:16:19 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/deepseek-ai/DeepGEMM/pull/266
Author: @yurekami
Created: 12/25/2025
Status: ❌ Closed

Base: main ← Head: add-conftest


📝 Commits (1)

  • 31a7434 Add pytest fixtures in conftest.py

📊 Changes

1 file changed (+112 additions, -0 deletions)

View changed files

➕ tests/conftest.py (+112 -0)

📄 Description

Description

Add pytest configuration and reusable fixtures for DeepGEMM tests.

Features

Auto-Configuration

  • Auto-marks tests based on file names (test_fp8.py → @pytest.mark.fp8)
  • Auto-skips GPU tests when CUDA is not available

Session Fixtures

Fixture Description
cuda_device Provides CUDA device, skips if unavailable
gpu_arch Returns GPU architecture major version (9=Hopper, 10=Blackwell)
is_hopper Boolean check for SM90 GPU
is_blackwell Boolean check for SM100 GPU
deep_gemm_module Provides imported deep_gemm module
env_vars Dict of common DeepGEMM environment variables

Test Fixtures

Fixture Description
reset_cuda_memory Auto-cleanup CUDA memory after each test (autouse)
random_seed Reproducible random state (seed=42)

Usage Example

def test_fp8_gemm(cuda_device, is_hopper):
    if not is_hopper:
        pytest.skip("Requires Hopper GPU")
    # test code using cuda_device...

Benefits

  • Automatic GPU detection and test skipping
  • Reusable fixtures reduce code duplication
  • Memory cleanup prevents OOM in test suites
  • Works with pytest.ini markers from PR #265

Testing

  • Valid Python syntax
  • Verify fixtures work with existing tests

🤖 Generated with Claude Code


🔄 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/266 **Author:** [@yurekami](https://github.com/yurekami) **Created:** 12/25/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `add-conftest` --- ### 📝 Commits (1) - [`31a7434`](https://github.com/deepseek-ai/DeepGEMM/commit/31a7434384c79576cb6b08c548fb1f5af1311a2f) Add pytest fixtures in conftest.py ### 📊 Changes **1 file changed** (+112 additions, -0 deletions) <details> <summary>View changed files</summary> ➕ `tests/conftest.py` (+112 -0) </details> ### 📄 Description ## Description Add pytest configuration and reusable fixtures for DeepGEMM tests. ## Features ### Auto-Configuration - Auto-marks tests based on file names (`test_fp8.py` → `@pytest.mark.fp8`) - Auto-skips GPU tests when CUDA is not available ### Session Fixtures | Fixture | Description | |---------|-------------| | `cuda_device` | Provides CUDA device, skips if unavailable | | `gpu_arch` | Returns GPU architecture major version (9=Hopper, 10=Blackwell) | | `is_hopper` | Boolean check for SM90 GPU | | `is_blackwell` | Boolean check for SM100 GPU | | `deep_gemm_module` | Provides imported deep_gemm module | | `env_vars` | Dict of common DeepGEMM environment variables | ### Test Fixtures | Fixture | Description | |---------|-------------| | `reset_cuda_memory` | Auto-cleanup CUDA memory after each test (autouse) | | `random_seed` | Reproducible random state (seed=42) | ### Usage Example ```python def test_fp8_gemm(cuda_device, is_hopper): if not is_hopper: pytest.skip("Requires Hopper GPU") # test code using cuda_device... ``` ## Benefits - Automatic GPU detection and test skipping - Reusable fixtures reduce code duplication - Memory cleanup prevents OOM in test suites - Works with pytest.ini markers from PR #265 ## Testing - [x] Valid Python syntax - [ ] Verify fixtures work with existing tests 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-26 21:16:19 +00:00
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#328
No description provided.