src_prepare-overlay/dev-python/sphinx-py3doc-enhanced-theme/files/Fix-goofy-doctest.patch

57 lines
1.5 KiB
Diff
Raw Normal View History

From 0183feb1bf833732233dcfd350db2beb26ed3f79 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ionel=20Cristian=20M=C4=83rie=C8=99?= <contact@ionelmc.ro>
Date: Sun, 6 Jun 2021 15:43:05 +0300
Subject: [PATCH] Fix goofy doctest. Ref #15.
---
tests/reference/foobar.rst | 13 +++++++------
tox.ini | 2 ++
2 files changed, 9 insertions(+), 6 deletions(-)
diff --git a/tests/reference/foobar.rst b/tests/reference/foobar.rst
index 4395458..db641b5 100644
--- a/tests/reference/foobar.rst
+++ b/tests/reference/foobar.rst
@@ -8,13 +8,14 @@
.. sourcecode:: pycon
>>> def fib(n):
- >>> a, b = 0, 1
- >>> while a < n:
- >>> print(a, end=' ')
- >>> a, b = b, a+b
- >>> print()
+ ... a, b = 0, 1
+ ... while a < n:
+ ... print('', a, end='')
+ ... a, b = b, a+b
+ ... print()
+
>>> fib(1000)
- 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
+ 0 1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987
.. sourcecode:: python
diff --git a/tox.ini b/tox.ini
index a865487..b0d333f 100644
--- a/tox.ini
+++ b/tox.ini
@@ -18,11 +18,13 @@ passenv =
deps =
sphinx
ghp-import2
+ pytest
commands =
clean: python -c 'import shutil; shutil.rmtree("dist", True)'
default: sphinx-build {posargs:-E} -b html tests dist/default
bare: sphinx-build {posargs:-E} -b html tests dist/bare
import: ghp-import -n -p -m "Update gh-pages." dist
+ test: pytest -ra
usedevelop = true
[testenv:check]
--
2.31.1