Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README.rst: Syntax highlight Python examples #4

Merged
merged 2 commits into from
Dec 15, 2014
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Installation
Usage
=====

::
.. code-block:: python

def test_my_stuff(benchmark):
with benchmark:
Expand Down Expand Up @@ -91,15 +91,21 @@ Usage
--benchmark-skip Skip running any benchmarks.
--benchmark-only Only run benchmarks.

Setting per-test options::
Setting per-test options:

.. code-block:: python

@pytest.mark.benchmark(group="group-name", max_time=0.5, max_iterations=5000, min_iterations=5, timer=time.time, disable_gc=True)
@pytest.mark.benchmark(
group="group-name", max_time=0.5,
max_iterations=5000, min_iterations=5,
timer=time.time, disable_gc=True)
def test_my_stuff(benchmark):
with benchmark:
# Code to be measured
result = time.sleep(0.000001)

# Extra code, to verify that the run completed correctly.
# Extra code, to verify that the run
# completed correctly.
# Note: this code is not measured.
assert result is None

Expand Down