mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2025-12-15 23:07:07 +00:00
improve test resilience
This commit is contained in:
@@ -229,10 +229,13 @@ class SubprocessTest(TestCase):
|
||||
self.assertTrue(sp.returncode == 0, f"{cwd} - git is unhappy")
|
||||
|
||||
content = sp.stdout
|
||||
ph = r"nothing to commit, working tree clean"
|
||||
phmatch = re.search(ph, content)
|
||||
msg = f'{cwd} - Failed to find expected git output: "{ph}"'
|
||||
self.assertIsNotNone(phmatch, msg)
|
||||
phs = [r"Your branch is up to date", r"nothing to commit, working tree clean", r"Your branch is ahead"]
|
||||
ok = None
|
||||
for ph in phs:
|
||||
if phmatch := re.search(ph, content): # WALRUS
|
||||
ok = True
|
||||
msg = f'{cwd} - Failed to find any nice git output: "{phs}"'
|
||||
self.assertIsNotNone(ok, msg)
|
||||
|
||||
# ph1 = r"no changes added to commit"
|
||||
# phmatch1 = re.search(ph1, content)
|
||||
|
||||
Reference in New Issue
Block a user