Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 2135a58

Browse filesBrowse files
committed
Fix: Misusing pytest.warns
1 parent 1cc8f71 commit 2135a58
Copy full SHA for 2135a58

File tree

Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-2
lines changed
Open diff view settings
Collapse file

‎scripts/test.py‎

Copy file name to clipboardExpand all lines: scripts/test.py
+3-2Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.