Skip to content

Commit 2135a58

Browse files
committed
Fix: Misusing pytest.warns
1 parent 1cc8f71 commit 2135a58

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

scripts/test.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import time
4444
import platform
4545
import collections
46+
import warnings
4647
from typing import Dict, List
4748

4849
import tabulate
@@ -1488,9 +1489,9 @@ def compute_with_threads(threads: int) -> float:
14881489

14891490
# Warn if multi-threaded execution is slower than the baseline
14901491
if baseline_duration < multi_duration:
1491-
pytest.warns(
1492-
UserWarning,
1492+
warnings.warn(
14931493
f"{num_threads}-threaded execution took longer than 2-threaded baseline: {multi_duration:.2f}s vs {baseline_duration:.2f}s",
1494+
UserWarning,
14941495
)
14951496

14961497

0 commit comments

Comments
 (0)