Use a pycon codeblock instead...
diff --git a/docs/random-numbers.rst b/docs/random-numbers.rst
index c8f95fd..cd73a7b 100644
--- a/docs/random-numbers.rst
+++ b/docs/random-numbers.rst
@@ -13,7 +13,7 @@
 example, if you need 16 bytes of random data for an initialization vector, you
 can obtain them with:
 
-.. doctest::
+.. code-block:: pycon
 
     >>> import os
     >>> os.urandom(16)