Skip to content

Commit

Permalink
Merge pull request #7632 from gmarkall/silence-cuda-doctests
Browse files Browse the repository at this point in the history
Capture output in CUDA matmul doctest
  • Loading branch information
esc committed Dec 9, 2021
2 parents 481d2f5 + 8e5305d commit 7b54373
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions numba/cuda/tests/doc_examples/test_matmul.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""
import unittest
from numba.cuda.testing import CUDATestCase, skip_on_cudasim
from numba.tests.support import captured_stdout


@skip_on_cudasim("cudasim doesn't support cuda import at non-top-level")
Expand All @@ -17,6 +18,17 @@ class TestMatMul(CUDATestCase):
memory/nonsquare cases.
"""

def setUp(self):
# Prevent output from this test showing up when running the test suite
self._captured_stdout = captured_stdout()
self._captured_stdout.__enter__()
super().setUp()

def tearDown(self):
# No exception type, value, or traceback
self._captured_stdout.__exit__(None, None, None)
super().tearDown()

def test_ex_matmul(self):
"""Test of matrix multiplication on various cases."""
# magictoken.ex_import.begin
Expand Down

0 comments on commit 7b54373

Please sign in to comment.