We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
top_level_dir
1 parent 23ade08 commit ed1c2e5Copy full SHA for ed1c2e5
src/diffpy/srfit/tests/__init__.py
@@ -41,11 +41,16 @@ def testsuite(pattern=''):
41
The TestSuite object containing the matching tests.
42
'''
43
import re
44
+ from os.path import dirname
45
from itertools import chain
46
from pkg_resources import resource_filename
47
loader = unittest.defaultTestLoader
48
thisdir = resource_filename(__name__, '')
- suite_all = loader.discover(thisdir)
49
+ depth = __name__.count('.') + 1
50
+ topdir = thisdir
51
+ for i in range(depth):
52
+ topdir = dirname(topdir)
53
+ suite_all = loader.discover(thisdir, top_level_dir=topdir)
54
# always filter the suite by pattern to test-cover the selection code.
55
suite = unittest.TestSuite()
56
rx = re.compile(pattern)
0 commit comments