Skip to content

Commit 76ab4c6

Browse files
committed
use code directive to get syntax highlighting
1 parent cdc2f07 commit 76ab4c6

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

posts/2022/03/how-is-pypy-tested.rst

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,9 @@ written in Python 2, using pytest. They tend to be more on the unit test side of
8888
things. They are in files with the pattern ``test_*.py``.
8989

9090
Here is an example that tests the implementation of integers (very slightly
91-
simplified)::
91+
simplified):
92+
93+
.. code:: python
9294
9395
class TestW_IntObject:
9496
...
@@ -134,7 +136,9 @@ look like "regular" Python 3 tests.
134136
subset of Python 3 that is also valid Python 2 syntax, leading to a lot of
135137
confusion.
136138
137-
Here's an example of how you could write a test equivalent to the one above::
139+
Here's an example of how you could write a test equivalent to the one above:
140+
141+
.. code:: python
138142
139143
def test_hash():
140144
assert hash(42) == 42
@@ -228,7 +232,9 @@ representation`_ that the JIT uses to produce machine code from.
228232
.. _`intermediate representation`: https://www.pypy.org/posts/2018/09/the-first-15-years-of-pypy-3412615975376972020.html
229233

230234
As an example, here is a small test that loading the attribute of a constant
231-
global instance can be completely constant folded away::
235+
global instance can be completely constant folded away
236+
237+
.. code:: python
232238
233239
def test_load_attr(self):
234240
src = '''

0 commit comments

Comments
 (0)