From c6bef77b021fcc998f2f14561f2450a9a8a546db Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Sun, 14 Dec 2014 17:01:38 -0800 Subject: [PATCH 1/2] README.rst: Syntax highlight Python examples --- README.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index bd0692d..d68a826 100644 --- a/README.rst +++ b/README.rst @@ -63,7 +63,7 @@ Installation Usage ===== -:: +.. code-block:: python def test_my_stuff(benchmark): with benchmark: @@ -91,7 +91,9 @@ 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) def test_my_stuff(benchmark): From 1a4c5c064753c8a0c02e49aa93c428a41c5716e5 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Sun, 14 Dec 2014 17:06:28 -0800 Subject: [PATCH 2/2] README.rst: wrap long lines For comfortable reading on mobile devices. --- README.rst | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index d68a826..bddf069 100644 --- a/README.rst +++ b/README.rst @@ -95,13 +95,17 @@ 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