From e0416485cd03629087a1345a2dd26928e0c3d2e1 Mon Sep 17 00:00:00 2001 From: jack-parsons <jack.parsons.uk@icloud.com> Date: Wed, 24 Jul 2019 12:18:41 +0100 Subject: [PATCH] Testing doctest failure (should fail) --- .gitlab-ci.yml | 2 +- AmpScan/core.py | 9 ++++++--- tests/doctests.py | 8 ++++++++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 tests/doctests.py diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 45acf75..fc5e791 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,4 +1,4 @@ unittests: script: python -m unittest discover tests -v doctests: - script: python -m doctest -v AmpScan/core.py + script: python /tests/doctests.py diff --git a/AmpScan/core.py b/AmpScan/core.py index 1e36006..834c775 100644 --- a/AmpScan/core.py +++ b/AmpScan/core.py @@ -37,7 +37,8 @@ class AmpObject(trimMixin, smoothMixin, analyseMixin, visMixin): Examples ------- >>> import AmpScan - >>> filename = "../tests/stl_file.stl" + >>> import os + >>> filename = os.getcwd()+"\\tests\\stl_file.stl" >>> amp = AmpObject(filename) """ @@ -150,7 +151,8 @@ class AmpObject(trimMixin, smoothMixin, analyseMixin, visMixin): Examples -------- - >>> filename = "../tests/stl_file.stl" + >>> import os + >>> filename = os.getcwd()+"\\tests\\stl_file.stl" >>> amp = AmpObject(filename, unify=False) >>> amp.vert.shape (44832, 3) @@ -347,7 +349,8 @@ class AmpObject(trimMixin, smoothMixin, analyseMixin, visMixin): Examples -------- - >>> filename = "../tests/stl_file.stl" + >>> import os + >>> filename = os.getcwd()+"\\tests\\stl_file.stl" >>> amp = AmpObject(filename) >>> ang = [np.pi/2, -np.pi/4, np.pi/3] >>> amp.rotateAng(ang, ang='rad') diff --git a/tests/doctests.py b/tests/doctests.py new file mode 100644 index 0000000..66e71b2 --- /dev/null +++ b/tests/doctests.py @@ -0,0 +1,8 @@ +import AmpScan.core as core +import AmpScan.trim as trim + +if __name__ == '__main__': + import doctest + doctest.testmod(core, verbose=True) + doctest.testmod(trim, verbose=True) + -- GitLab