Skip to content

Commit 67bbe3f

Browse files
committed
Add some perf tests.
1 parent 10413a2 commit 67bbe3f

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

pytest.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ addopts =
1818
--doctest-modules
1919
--doctest-glob=\*.rst
2020
--tb=short
21+
--benchmark-disable
2122
testpaths =
2223
tests
2324

tests/test_perf.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
from tblib import Traceback
2+
3+
EXAMPLE = """
4+
Traceback (most recent call last):
5+
File "file1", line 9999, in <module>
6+
code1
7+
File "file2", line 9999, in <module>
8+
code2
9+
File "file3", line 9999, in <module>
10+
code3
11+
File "file4", line 9999, in <module>
12+
code4
13+
File "file5", line 9999, in <module>
14+
code5
15+
File "file6", line 9999, in <module>
16+
code6
17+
File "file7", line 9999, in <module>
18+
code7
19+
File "file8", line 9999, in <module>
20+
code8
21+
File "file9", line 9999, in <module>
22+
code9
23+
"""
24+
25+
26+
def test_perf(benchmark):
27+
@benchmark
28+
def run():
29+
Traceback.from_string(EXAMPLE).as_traceback()

tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ usedevelop = false
3939
deps =
4040
pytest
4141
pytest-cov
42+
pytest-benchmark
4243
commands =
4344
{posargs:pytest --cov --cov-report=term-missing --cov-report=xml -vv tests}
4445

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy