summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2025-01-17 18:40:36 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2025-01-17 18:40:36 +0000
commitd49d2eeceeaf41406a466223f0028afceccb666a (patch)
treef718a8d3a222b4f079662e30649e8e75292a06df
parent05c687b25362f600f6d0428f9f756717edeaa26c (diff)
downloadtroggle-d49d2eeceeaf41406a466223f0028afceccb666a.tar.gz
troggle-d49d2eeceeaf41406a466223f0028afceccb666a.tar.bz2
troggle-d49d2eeceeaf41406a466223f0028afceccb666a.zip
improve test resilience
-rw-r--r--core/TESTS/test_imports.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py
index 9a40041..322fc9d 100644
--- a/core/TESTS/test_imports.py
+++ b/core/TESTS/test_imports.py
@@ -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)