diff --git a/test/test-release.sh b/test/test-release.sh index 846ee530..2d54c08e 100755 --- a/test/test-release.sh +++ b/test/test-release.sh @@ -257,6 +257,11 @@ t_obj=" " f_obj='Data object tests completed' +[ "$PYTHONOPTIMIZE" ] && { + echo -e "${YELLOW}PYTHONOPTIMIZE set, skipping object tests$RESET" + t_obj_skip='-' +} + i_color='Color' s_color='Testing terminal colors' t_color="- $colortest_py" diff --git a/test/test_py_d/ts_misc.py b/test/test_py_d/ts_misc.py index 6033790d..8d3995c2 100755 --- a/test/test_py_d/ts_misc.py +++ b/test/test_py_d/ts_misc.py @@ -79,6 +79,11 @@ class TestSuiteHelp(TestSuiteBase): 'txsign','txdo','txbump')) def tool_help(self): + + if os.getenv('PYTHONOPTIMIZE') == '2': + ymsg('Skipping tool help with PYTHONOPTIMIZE=2 (no docstrings)') + return 'skip' + for args in ( ['--help'], ['--longhelp'], diff --git a/test/test_py_d/ts_regtest.py b/test/test_py_d/ts_regtest.py index 4674af0e..3a8c5699 100755 --- a/test/test_py_d/ts_regtest.py +++ b/test/test_py_d/ts_regtest.py @@ -900,6 +900,9 @@ class TestSuiteRegtest(TestSuiteBase,TestSuiteShared): return self._user_chk_label('alice',mmid,'Label added using coin address of MMGen address') def alice_add_label_badaddr(self,addr,reply): + if os.getenv('PYTHONOPTIMIZE'): + omsg(yellow(f'PYTHONOPTIMIZE set, skipping test {self.test_name!r}')) + return 'skip' t = self.spawn('mmgen-tool',['--alice','add_label',addr,'(none)']) t.expect(reply,regex=True) return t diff --git a/test/unit_tests.py b/test/unit_tests.py index fc3ee8ed..721ace81 100755 --- a/test/unit_tests.py +++ b/test/unit_tests.py @@ -75,6 +75,9 @@ class UnitTestHelpers(object): @classmethod def process_bad_data(cls,data): + if os.getenv('PYTHONOPTIMIZE'): + ymsg('PYTHONOPTIMIZE set, skipping error handling tests') + return import re desc_w = max(len(e[0]) for e in data) exc_w = max(len(e[1]) for e in data)