permit execution of tests with optimization set
- all tests except object tests now run with PYTHONOPTIMIZE=2
This commit is contained in:
parent
6b3ea8b251
commit
b995cbf71e
4 changed files with 16 additions and 0 deletions
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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'],
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue