nixpkgs/pkgs/applications/science/math/sage/patches/Only-test-py2-py3-optional-tests-when-all-of-sage-is.patch
Timo Kaufmann db75fe7313 sage: fix doctest
The test is depending on the "py2" tag always being added. I patched
that recently to make it possible to test sagedoc individually. Somehow
I missed this doctest.
2018-10-22 14:52:19 +02:00

36 lines
1.2 KiB
Diff

From 8218bd4fdeb4c92de8af0d3aabec55980fc4fb3d Mon Sep 17 00:00:00 2001
From: Timo Kaufmann <timokau@zoho.com>
Date: Sun, 21 Oct 2018 17:52:40 +0200
Subject: [PATCH] Only test py2/py3 optional tests when all of sage is tested
---
src/sage/doctest/control.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/src/sage/doctest/control.py b/src/sage/doctest/control.py
index bf18df8b2b..935c67abf7 100644
--- a/src/sage/doctest/control.py
+++ b/src/sage/doctest/control.py
@@ -362,7 +362,8 @@ class DocTestController(SageObject):
if not optionaltag_regex.search(o):
raise ValueError('invalid optional tag {!r}'.format(o))
- options.optional |= auto_optional_tags
+ if "sage" in options.optional:
+ options.optional |= auto_optional_tags
self.options = options
@@ -765,7 +766,7 @@ class DocTestController(SageObject):
sage: DC = DocTestController(DD, [dirname])
sage: DC.expand_files_into_sources()
sage: sorted(DC.sources[0].options.optional) # abs tol 1
- ['guava', 'magma', 'py2']
+ ['guava', 'magma']
We check that files are skipped appropriately::
--
2.18.1