Browse Source

test.py: fix bug in direct call feature

The MMGen Project 3 years ago
parent
commit
c5f3745550
1 changed files with 2 additions and 4 deletions
  1. 2 4
      test/test.py

+ 2 - 4
test/test.py

@@ -783,10 +783,8 @@ class TestSuiteRunner(object):
 				else:
 				else:
 					if ':' in arg:
 					if ':' in arg:
 						gname,arg = arg.split(':')
 						gname,arg = arg.split(':')
-						direct_call_ok = True # allow calling of functions not in cmd_group
 					else:
 					else:
 						gname = self.gm.find_cmd_in_groups(arg)
 						gname = self.gm.find_cmd_in_groups(arg)
-						direct_call_ok = False
 					if gname:
 					if gname:
 						same_grp = gname == gname_save # same group as previous cmd: don't clean, suppress blue msg
 						same_grp = gname == gname_save # same group as previous cmd: don't clean, suppress blue msg
 						if not self.init_group(gname,arg,quiet=same_grp):
 						if not self.init_group(gname,arg,quiet=same_grp):
@@ -795,8 +793,8 @@ class TestSuiteRunner(object):
 							clean(self.ts.tmpdir_nums)
 							clean(self.ts.tmpdir_nums)
 						try:
 						try:
 							self.check_needs_rerun(arg,build=True)
 							self.check_needs_rerun(arg,build=True)
-						except:
-							if direct_call_ok:
+						except Exception as e: # allow calling of functions not in cmd_group
+							if isinstance(e,KeyError) and e.args[0] == arg:
 								ret = getattr(self.ts,arg)()
 								ret = getattr(self.ts,arg)()
 								if type(ret).__name__ == 'coroutine':
 								if type(ret).__name__ == 'coroutine':
 									run_session(ret)
 									run_session(ret)