File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
src/diffpy/Structure/tests Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -34,11 +34,16 @@ def testsuite(pattern=''):
3434 The TestSuite object containing the matching tests.
3535 '''
3636 import re
37+ from os .path import dirname
3738 from itertools import chain
3839 from pkg_resources import resource_filename
3940 loader = unittest .defaultTestLoader
4041 thisdir = resource_filename (__name__ , '' )
41- suite_all = loader .discover (thisdir , pattern = 'Test*.py' )
42+ depth = __name__ .count ('.' ) + 1
43+ topdir = thisdir
44+ for i in range (depth ):
45+ topdir = dirname (topdir )
46+ suite_all = loader .discover (thisdir , pattern = 'Test*.py' , top_level_dir = topdir )
4247 # always filter the suite by pattern to test-cover the selection code.
4348 suite = unittest .TestSuite ()
4449 rx = re .compile (pattern )
You can’t perform that action at this time.
0 commit comments