Added package directory
authorThierry Florac <tflorac@ulthar.net>
Wed, 18 Nov 2020 12:58:36 +0100
changeset 58 aa51effb1d8a
parent 57 15edce13160b
child 59 917951020682
Added package directory
src/pyams_viewlet/tests/test_utilsdocstrings.py
--- a/src/pyams_viewlet/tests/test_utilsdocstrings.py	Wed Dec 04 11:21:29 2019 +0100
+++ b/src/pyams_viewlet/tests/test_utilsdocstrings.py	Wed Nov 18 12:58:36 2020 +0100
@@ -16,9 +16,10 @@
 
 import doctest
 import os
-import sys
 import unittest
 
+from pyams_viewlet.tests import get_package_dir
+
 
 __docformat__ = 'restructuredtext'
 
@@ -34,9 +35,7 @@
     flags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE |
              doctest.REPORT_ONLY_FIRST_FAILURE)
 
-    package_dir = os.path.split(test_dir)[0]
-    if package_dir not in sys.path:
-        sys.path.append(package_dir)
+    package_dir = get_package_dir(test_dir)
 
     # filtering files on extension
     docs = [doc for doc in