Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Two failures on openSUSE #8

Open
jayvdb opened this issue Dec 12, 2019 · 2 comments
Open

Two failures on openSUSE #8

jayvdb opened this issue Dec 12, 2019 · 2 comments

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Dec 12, 2019

With the patch for #7 applied against the current release, I get the following two errors.

Maybe they have been fixed on master. I'll try that next..

[   67s] =================================== FAILURES ===================================
[   67s] ________________________ ColrToolTests.test_list_codes _________________________
[   67s] 
[   67s] self = <test.test_colr_tool.ColrToolTests testMethod=test_list_codes>
[   67s] 
[   67s]     def test_list_codes(self):
[   67s]         """ colr tool should list escape codes with --listcodes. """
[   67s]         cases = {
[   67s]             s: str(Colr('test', s))
[   67s]             for s in ('red', 'blue', 'green', 'white')
[   67s]         }
[   67s]         for name, s in cases.items():
[   67s]             argd = {'TEXT': s, '--listcodes': True}
[   67s]             self.assertMainIn(
[   67s]                 argd,
[   67s]                 stdout=name,
[   67s] >               msg='main() with --listcodes did not recognize an escape code.',
[   67s]             )
[   67s] 
[   67s] test/test_colr_tool.py:334: 
[   67s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   67s] test/testing_tools.py:694: in assertMainIn
[   67s]     msg='main() returned a non-zero exit status.',
[   67s] _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
[   67s] 
[   67s] self = <test.test_colr_tool.ColrToolTests testMethod=test_list_codes>, a = 1
[   67s] b = 0, msg = 'main() returned a non-zero exit status.'
[   67s] 
[   67s]     def assertEqual(self, a, b, msg=None):
[   67s]         if a == b:
[   67s]             return None
[   67s] >       raise self.failureException(_equality_msg('!=', a, b, msg=msg))
[   67s] E       AssertionError: 
[   67s] E         1 !=
[   67s] E         0
[   67s] E       
[   67s] E       main() returned a non-zero exit status.
[   67s] 
[   67s] test/testing_tools.py:417: AssertionError
[   67s] __________________________ ColrToolTests.test_styles ___________________________
[   67s] 
[   67s] self = <test.test_colr_tool.ColrToolTests testMethod=test_styles>
[   67s] 
[   67s]     def test_styles(self):
[   67s]         """ colr tool should recognize styles. """
[   67s]         argd = {'TEXT': 'Hello World', 'FORE': '235', 'STYLE': 'normal'}
[   67s]         for _ in range(10):
[   67s]             argd['STYLE'] = r.choice(self.valid_style_vals)
[   67s]             self.assertMain(argd, msg='main() failed with valid style arg.')
[   67s]         # Invalid style values should raise a InvalidStyle.
[   67s]         badargsets = (
[   67s]             {'STYLE': 'dimmer'},
[   67s]             {'STYLE': 'x'},
[   67s]         )
[   67s]         for argset in badargsets:
[   67s]             argd.update(argset)
[   67s]             with self.assertRaises(InvalidStyle):
[   67s] >               self.run_main_test(argd, should_fail=True)
[   67s] E               AssertionError: InvalidStyle not raised
[   67s] 
[   67s] test/test_colr_tool.py:427: AssertionError
@jayvdb
Copy link
Contributor Author

jayvdb commented Dec 12, 2019

Another possible cause is they are not using main(), but are instead using 'python -m ..' - the latter would fail until replaced with sys.executable

@cjwelborn
Copy link
Member

Ahh, yes that might explain it. I'll take a look.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants