@@ -642,7 +642,7 @@ def save_next(self):
642
642
tests_run = 0
643
643
644
644
class TestParserPasses (unittest .TestCase ):
645
- directory = "blurb/ tests/pass"
645
+ directory = "tests/pass"
646
646
647
647
def filename_test (self , filename ):
648
648
b = Blurbs ()
@@ -667,7 +667,7 @@ def test_files(self):
667
667
668
668
669
669
class TestParserFailures (TestParserPasses ):
670
- directory = "blurb/ tests/fail"
670
+ directory = "tests/fail"
671
671
672
672
def filename_test (self , filename ):
673
673
b = Blurbs ()
@@ -820,6 +820,15 @@ def help(subcommand=None):
820
820
subcommands ["--help" ] = help
821
821
822
822
823
+ def _find_blurb_dir ():
824
+ if os .path .isdir ("blurb" ):
825
+ return "blurb"
826
+ for path in glob .iglob ("blurb-*" ):
827
+ if os .path .isdir (path ):
828
+ return path
829
+ return None
830
+
831
+
823
832
@subcommand
824
833
def test (* args ):
825
834
"""
@@ -828,12 +837,13 @@ def test(*args):
828
837
# unittest.main doesn't work because this isn't a module
829
838
# so we'll do it ourselves
830
839
831
- while not os . path . isdir ( "blurb" ) :
840
+ while ( blurb_dir := _find_blurb_dir ()) is None :
832
841
old_dir = os .getcwd ()
833
842
os .chdir (".." )
834
843
if old_dir == os .getcwd ():
835
844
# we reached the root and never found it!
836
845
sys .exit ("Error: Couldn't find the root of your blurb repo!" )
846
+ os .chdir (blurb_dir )
837
847
838
848
print ("-" * 79 )
839
849
0 commit comments