-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
TST: remove unnecessary test fixture (#70)
The custom `warns` fixture is no longer necessary.
- Loading branch information
Showing
2 changed files
with
2 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,10 @@ | ||
import warnings | ||
from contextlib import contextmanager | ||
|
||
import numpy as np | ||
import pytest | ||
from numba import config | ||
|
||
config.DISABLE_JIT = True | ||
|
||
|
||
@contextmanager | ||
def warns(*types): | ||
if types == (None,): | ||
with warnings.catch_warnings(): | ||
warnings.simplefilter("error") | ||
try: | ||
yield | ||
finally: | ||
pass | ||
else: | ||
with pytest.warns(*types): | ||
try: | ||
yield | ||
finally: | ||
pass | ||
|
||
|
||
@pytest.fixture(scope="session") | ||
def rng(seed: int = 50) -> np.random.Generator: | ||
return np.random.default_rng(seed) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters