@@ -465,6 +465,19 @@ def do_test(arg):
465465 except runner .NoTestPlanError :
466466 runner .error (cfg , ['No challenge selected.' ,
467467 'Use `tanco init`, `tanco test -t file.org`, or set TEST_PLAN environment variable.' ])
468+ except runner .NoTestsFoundError as e :
469+ runner .error (cfg , [str (e ),
470+ '' ,
471+ 'For org files, tests should be defined using:' ,
472+ ' ** TEST testname : title' ,
473+ ' #+begin_src' ,
474+ ' > input line' ,
475+ ' expected output' ,
476+ ' #+end_src' ])
477+ except FileNotFoundError as e :
478+ runner .error (cfg , [f'Test file not found: { e .filename } ' ,
479+ '' ,
480+ 'Make sure the path is correct and the file exists.' ])
468481 except runner .StopTesting :
469482 pass
470483 except Exception :
@@ -531,8 +544,21 @@ def do_run(self, arg):
531544 runner .run_tests (cfg )
532545 except runner .NoTestPlanError :
533546 print ("No tests specified. Use --tests PATH or ensure you're in a tanco project." )
547+ except runner .NoTestsFoundError as e :
548+ print (str (e ))
549+ print ()
550+ print ('For org files, tests should be defined using:' )
551+ print (' ** TEST testname : title' )
552+ print (' #+begin_src' )
553+ print (' > input line' )
554+ print (' expected output' )
555+ print (' #+end_src' )
556+ except FileNotFoundError as e :
557+ print (f'Test file not found: { e .filename } ' )
558+ print ()
559+ print ('Make sure the path is correct and the file exists.' )
534560 except runner .StopTesting :
535- pass # Normal exit after test failure
561+ pass # Normal exit after test failure
536562 except Exception :
537563 # handle_unexpected_error already prints traceback
538564 runner .handle_unexpected_error (cfg )
0 commit comments