Skip to content

Commit 8a931d3

Browse files
committed
flatten class.
1 parent 90f1505 commit 8a931d3

1 file changed

Lines changed: 12 additions & 13 deletions

File tree

cuda_core/tests/example_tests/test_basic_examples.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -103,16 +103,15 @@ def has_recent_memory_pool_support() -> bool:
103103

104104

105105
@pytest.mark.parametrize("example_rel_path", SAMPLE_FILES)
106-
class TestExamples:
107-
# deinit_cuda is defined in conftest.py and pops the cuda context automatically.
108-
def test_example(self, example_rel_path: str, deinit_cuda) -> None:
109-
example_path = str(EXAMPLES_DIR / example_rel_path)
110-
has_package_requirements_or_skip(example_path)
111-
112-
system_requirement = SYSTEM_REQUIREMENTS.get(example_rel_path, lambda: True)
113-
if not system_requirement():
114-
pytest.skip(f"Skipping {example_rel_path} due to unmet system requirement")
115-
116-
# redundantly set current device to 0 in case previous example was multi-GPU
117-
Device(0).set_current()
118-
run_example(str(EXAMPLES_DIR), example_rel_path)
106+
# deinit_cuda is defined in conftest.py and pops the cuda context automatically.
107+
def test_example(example_rel_path: str, deinit_cuda) -> None:
108+
example_path = str(EXAMPLES_DIR / example_rel_path)
109+
has_package_requirements_or_skip(example_path)
110+
111+
system_requirement = SYSTEM_REQUIREMENTS.get(example_rel_path, lambda: True)
112+
if not system_requirement():
113+
pytest.skip(f"Skipping {example_rel_path} due to unmet system requirement")
114+
115+
# redundantly set current device to 0 in case previous example was multi-GPU
116+
Device(0).set_current()
117+
run_example(str(EXAMPLES_DIR), example_rel_path)

0 commit comments

Comments
 (0)