#8699: allow doctest coverage script to handle triple single quotes
---------------------------------------------+------------------------------
Reporter: mvngu | Owner: tbd
Type: enhancement | Status: needs_work
Priority: minor | Milestone: sage-4.4
Component: doctest | Keywords:
Author: Minh Van Nguyen | Upstream: N/A
Reviewer: | Merged:
Work_issues: Slight bug in implementation. |
---------------------------------------------+------------------------------
Comment(by mvngu):
Replying to [comment:6 timdumol]:
> attachment:trac_8699-documentation.patch works as advertised, but I
believe attachment:trac_8699-single-quotes.patch will choke on something
like this:
I don't think I understand your test case. Say I put your test case in a
module, e.g. devel/sage-main/sage/graphs/graph_generators.py:
{{{
#!diff
[mv...@sage sage-main]$ hg diff
diff --git a/sage/graphs/graph_generators.py
b/sage/graphs/graph_generators.py
--- a/sage/graphs/graph_generators.py
+++ b/sage/graphs/graph_generators.py
@@ -168,6 +168,17 @@
from math import sin, cos, pi
from sage.misc.randstate import current_randstate
+def foo():
+ '''
+ foobarbaz
+ """
+
+ """
+ [..]
+ bar baz
+ '''
+ pass
+
class GraphGenerators():
r"""
A class consisting of constructors for several common graphs, as
}}}
Running the doctest coverage script over this modified module reported the
following:
{{{
#!sh
[mv...@sage sage-4.4.alpha0-8699-quotes]$ ./sage -coverage devel/sage-
main/sage/graphs/graph_generators.py
----------------------------------------------------------------------
devel/sage-main/sage/graphs/graph_generators.py
ERROR: Please add a `TestSuite(s).run()` doctest.
SCORE devel/sage-main/sage/graphs/graph_generators.py: 98% (74 of 75)
Missing doctests:
* foo():
----------------------------------------------------------------------
}}}
So we have added another function, which is missing doctests. Or do you
mean that the coverage script needs to ensure a balance of triple
single/double quotes? In that case, I think a decent text editor that
supports Python/Cython syntax would do a better job to highlight if we
have, say, a triple single quotes for starting a docstring but triple
double quotes to end the docstring.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/8699#comment:8>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.