summaryrefslogtreecommitdiffstats
path: root/core/TESTS
diff options
context:
space:
mode:
authorPhilip Sargent <philip.sargent@gmail.com>2022-11-23 21:59:42 +0000
committerPhilip Sargent <philip.sargent@gmail.com>2022-11-23 21:59:42 +0000
commit1eab261b3034100afed6e2b4ea2303641176eb93 (patch)
tree278b1aba70e265a9a8e3833276a8cf53b52ab5bc /core/TESTS
parentb06d1dae4222cdb6e50fef629967bc76625b52e9 (diff)
downloadtroggle-1eab261b3034100afed6e2b4ea2303641176eb93.tar.gz
troggle-1eab261b3034100afed6e2b4ea2303641176eb93.tar.bz2
troggle-1eab261b3034100afed6e2b4ea2303641176eb93.zip
fix bugs made visible by py 3.11
Diffstat (limited to 'core/TESTS')
-rw-r--r--core/TESTS/test_imports.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/TESTS/test_imports.py b/core/TESTS/test_imports.py
index b4838f6..238523a 100644
--- a/core/TESTS/test_imports.py
+++ b/core/TESTS/test_imports.py
@@ -152,9 +152,12 @@ class SubprocessTest(TestCase):
TROGGLE_PATH = Path(settings.REPOS_ROOT_PATH) / "troggle"
for cwd in [settings.SURVEX_DATA, settings.EXPOWEB, settings.DRAWINGS_DATA, TROGGLE_PATH]:
sp = subprocess.run([settings.GIT, "status"], cwd=cwd, capture_output=True, text=True)
- print(f'git output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
+ out = str(sp.stdout)
+ if len(out) > 160:
+ out = out[:75] + "\n <Long output curtailed>\n" + out[-75:]
+ print(f'git output: {cwd}:\n # {sp.stderr=}\n # sp.stdout={out} \n # return code: {str(sp.returncode)}')
if sp.returncode != 0:
- print(f'git output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
+ print(f'git output: {cwd}:\n # {sp.stderr=}\n # sp.stdout={out} \n # return code: {str(sp.returncode)}')
self.assertTrue( sp.returncode == 0, f'{cwd} - git is unhappy')
@@ -180,9 +183,12 @@ class SubprocessTest(TestCase):
cwd = settings.SURVEX_DATA
for survey in ["1623.svx", "1626.svx"]:
sp = subprocess.run([settings.CAVERN, survey], cwd=cwd, capture_output=True, text=True)
- print(f'survex output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
+ out = str(sp.stdout)
+ if len(out) > 160:
+ out = out[:75] + "\n <Long output curtailed>\n" + out[-75:]
+ # print(f'survex output: {cwd}:\n # {sp.stderr=}\n # sp.stdout={out} \n # return code: {str(sp.returncode)}')
if sp.returncode != 0:
- print(f'survex output: {cwd}:\n # {sp.stderr=}\n # {sp.stdout=} \n # return code: {str(sp.returncode)}')
+ print(f'survex output: {cwd}:\n # {sp.stderr=}\n # sp.stdout={out} \n # return code: {str(sp.returncode)}')
self.assertTrue( sp.returncode == 0, f'{cwd} - survex is unhappy')