Skip to content

Commit 64c708e

Browse files
committed
footnotes differently
1 parent 76ab4c6 commit 64c708e

File tree

1 file changed

+27
-18
lines changed

1 file changed

+27
-18
lines changed

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

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -124,17 +124,8 @@ There is also a second class of tests for the interpreter. Those are tests that
124124
don't run on the level of the implementation. Instead, they are executed *by*
125125
the PyPy Python interpreter, thus running on the level of the applications run
126126
by PyPy. Since the interpreter is running Python 3, the tests are also written
127-
in Python 3. They are stored in files with the pattern ``apptest_*.py`` _[#] and
128-
look like "regular" Python 3 tests.
129-
130-
.. [#] There is also a deprecated different way to write these tests, by putting
131-
them in the ``test_*.py`` files that interpreter level tests are using and
132-
then having a test class with the pattern ``class AppTest*``. We haven't
133-
converted all of them to the new style yet, even though the old style is
134-
quite weird: since the ``test_*.py`` files are themselves parsed by
135-
Python 2, the tests methods in ``AppTest*`` classes need to be written in the
136-
subset of Python 3 that is also valid Python 2 syntax, leading to a lot of
137-
confusion.
127+
in Python 3. They are stored in files with the pattern ``apptest_*.py`` and
128+
look like "regular" Python 3 tests. `¹`_
138129

139130
Here's an example of how you could write a test equivalent to the one above:
140131

@@ -163,13 +154,7 @@ fast, given that they run on a stack of two different interpreters.
163154

164155
Application-level tests correspond quite closely to CPython's tests suite (which
165156
is using the unittest framework). Of course in CPython it is not possible to run
166-
the test suite without building the CPython binary using a C compiler. _[#]
167-
168-
.. [#] Nit-picky side-note: `C interpreters`_ `are a thing`_! But not that
169-
widely used in practice, or only in very specific situations.
170-
171-
.. _`C interpreters`: https://root.cern.ch/root/html534/guides/users-guide/CINT.html
172-
.. _`are a thing`: https://www.youtube.com/watch?v=yyDD_KRdQQU
157+
the test suite without building the CPython binary using a C compiler. `²`_
173158

174159
So when do we write application-level tests, and when interpreter-level tests?
175160
Interpreter-level tests are necessary to test internal data structures that
@@ -294,3 +279,27 @@ to develop the PyPy Python interpreter.
294279
There is a whole other set of tests for the development of the RPython language,
295280
the garbage collectors it provides as well as the code that does the automatic
296281
JIT insertion, maybe I'll cover these in a future post.
282+
283+
284+
Footnotes
285+
-----------
286+
287+
.. _`¹`:
288+
289+
¹ There is also a deprecated different way to write these tests, by putting
290+
them in the ``test_*.py`` files that interpreter level tests are using and
291+
then having a test class with the pattern ``class AppTest*``. We haven't
292+
converted all of them to the new style yet, even though the old style is
293+
quite weird: since the ``test_*.py`` files are themselves parsed by
294+
Python 2, the tests methods in ``AppTest*`` classes need to be written in the
295+
subset of Python 3 that is also valid Python 2 syntax, leading to a lot of
296+
confusion.
297+
298+
.. _`²`:
299+
300+
² Nit-picky side-note: `C interpreters`_ `are a thing`_! But not that
301+
widely used in practice, or only in very specific situations.
302+
303+
.. _`C interpreters`: https://root.cern.ch/root/html534/guides/users-guide/CINT.html
304+
.. _`are a thing`: https://www.youtube.com/watch?v=yyDD_KRdQQU
305+

0 commit comments

Comments
 (0)