mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-08 13:18:15 +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")
|
self.assertTrue(sp.returncode == 0, f"{cwd} - git is unhappy")
|
||||||
|
|
||||||
content = sp.stdout
|
content = sp.stdout
|
||||||
ph = r"nothing to commit, working tree clean"
|
phs = [r"Your branch is up to date", r"nothing to commit, working tree clean", r"Your branch is ahead"]
|
||||||
phmatch = re.search(ph, content)
|
ok = None
|
||||||
msg = f'{cwd} - Failed to find expected git output: "{ph}"'
|
for ph in phs:
|
||||||
self.assertIsNotNone(phmatch, msg)
|
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"
|
# ph1 = r"no changes added to commit"
|
||||||
# phmatch1 = re.search(ph1, content)
|
# phmatch1 = re.search(ph1, content)
|
||||||
|
|||||||
Reference in New Issue
Block a user