From f67476f065a2ef7c4b03fcad486ace6e08d9230c Mon Sep 17 00:00:00 2001 From: Tobias Diez Date: Sun, 27 Mar 2022 15:50:44 +0200 Subject: [PATCH] Add some test and prelimary code --- .vscode/settings.json | 6 +++++- src/test_doctest.py | 11 +++++++++++ src/tox.ini | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 src/test_doctest.py diff --git a/.vscode/settings.json b/.vscode/settings.json index 5844f80998f..9cdc0e3b980 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -14,9 +14,13 @@ "pkgs/sagemath-objects/sage": true, "pkgs/sagemath-standard/sage": true, }, + "python.testing.pytestPath": "./sage -t", "python.testing.pytestEnabled": true, "python.testing.pytestArgs": [ - "src" + "src/test_doctests.py", + "--rootdir=src/sage", + "-c=src/tox.ini", + "--doctest-modules", ], "python.testing.unittestEnabled": false, } diff --git a/src/test_doctest.py b/src/test_doctest.py new file mode 100644 index 00000000000..37cb7d89995 --- /dev/null +++ b/src/test_doctest.py @@ -0,0 +1,11 @@ +def something(): + """ a doctest in a docstring + >>> something() + 42 + + some other doctest + + >>> something() + 1 + 43 + """ + return 42 diff --git a/src/tox.ini b/src/tox.ini index 58aa21be8a5..e15471fd742 100644 --- a/src/tox.ini +++ b/src/tox.ini @@ -155,6 +155,7 @@ commands = codespell \ [pytest] python_files = *_test.py +norecursedirs = local prefix venv build pkgs .git src/sage/pkgs src/doc src/bin src/sage/src/sage_setup [coverage:run] source = sage