From 63cc658f685313c5f09343689e680b020da87301 Mon Sep 17 00:00:00 2001 From: ProfessorO Date: Sun, 4 Oct 2020 16:52:00 -0400 Subject: [PATCH] Stub for doctest.testmod() Just enough so "import doctest; doctest.testmod()" in student programs that rely on the doctest module doesn't fail. Instead, an error message reminding the user to run those doctests in an IDE is printed, and the doctests are "silently" ignored. --- src/lib/doctest.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lib/doctest.py b/src/lib/doctest.py index 2ab49db972..4bcdd3b4c4 100644 --- a/src/lib/doctest.py +++ b/src/lib/doctest.py @@ -1 +1,9 @@ -raise NotImplementedError("doctest is not yet implemented in Skulpt") +"""Stub implementation for Runestone Interactive books so students' doctests don't fail.""" + +message = "The doctest module is not yet implemented by Skulpt. Please run your doctests in your own IDE!" + +def testmod(): + print(message) + +if __name__ == "__main__": + print(message)