Skip to content

Commit 651d394

Browse files
committed
docs: add a unittest benchmark example
1 parent 8933947 commit 651d394

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed
+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import unittest
2+
3+
import pytest
4+
5+
6+
class MyBenchmark(unittest.TestCase):
7+
def setUp(self):
8+
# Initialize the benchmark environment
9+
self.input = (
10+
"Lorem Ipsum is simply dummy text of the printing and typesetting industry."
11+
* 100
12+
)
13+
14+
@pytest.mark.benchmark
15+
def test_bench_hash(self):
16+
hash(self.input)
17+
18+
def tearDown(self):
19+
# Clean up the benchmark environment
20+
pass

0 commit comments

Comments
 (0)