Skip to content

Commit 09d51cb

Browse files
authoredNov 10, 2022
Add Usage section to docs (CFMTech#62)
1 parent 32d0235 commit 09d51cb

File tree

1 file changed

+3
-21
lines changed

1 file changed

+3
-21
lines changed
 

‎docs/sources/introduction.rst

+3-21
Original file line numberDiff line numberDiff line change
@@ -25,25 +25,7 @@ Code evolution
2525
Extending your application with new features, or fixing its bugs, might have an impact on the core of your program. The performance of large applications or libraries can be difficult to assess, but by monitoring resource consumption, `pytest-monitor` allows you to check that despite code udpates, the performance of your code remains within desirable limits.
2626

2727

28-
Example
29-
-------
28+
Usage
29+
-----
3030

31-
.. code-block:: python
32-
33-
import pytest
34-
import time
35-
36-
37-
# Tests are run and monitored by default: no boilerplate code needed
38-
def test_sleep1():
39-
time.sleep(1)
40-
41-
# Run as a test, but do not monitor:
42-
@pytest.mark.monitor_skip_test
43-
def test_sleep2():
44-
time.sleep(2)
45-
46-
# Support for parametrized tests (monitored by default):
47-
@pytest.mark.parametrize(('range_max', 'other'), [(10, "10"), (100, "100"), (1000, "1000"), (10000, "10000")])
48-
def test_heavy(range_max, other):
49-
assert len(['a' * i for i in range(range_max)]) == range_max
31+
Simply run pytest as usual: pytest-monitor is active by default as soon as it is installed. After running your first session, a .pymon sqlite database will be accessible in the directory where pytest was run.

0 commit comments

Comments
 (0)
Please sign in to comment.