python: fix tests, remove intentional debug failures
This commit is contained in:
committed by
Tamara Dahlgren
parent
d53eefa69f
commit
97dc74c727
@@ -1692,7 +1692,7 @@ def run_test(self, exe, options=[], expected=[], status=None):
|
||||
for check in expected:
|
||||
cmd = ' '.join([exe] + options)
|
||||
msg = "Expected '%s' in output of `%s`" % (check, cmd)
|
||||
# msg += '\n%s' % output
|
||||
msg += '\n\nOutput: %s' % output
|
||||
assert check in output, msg
|
||||
|
||||
except ProcessError as err:
|
||||
|
||||
@@ -1111,21 +1111,15 @@ def remove_files_from_view(self, view, merge_map):
|
||||
os.remove(dst)
|
||||
|
||||
def test(self):
|
||||
self.run_test('true', expected=['not in output'])
|
||||
# guaranteed executable name
|
||||
# do not use self.command because we are also testing the run env
|
||||
exe = 'python3' if self.spec.satisfies('@3:') else 'python'
|
||||
|
||||
# contains python executable
|
||||
python = which('python')
|
||||
assert os.path.dirname(python.path) == os.path.dirname(
|
||||
self.command.path)
|
||||
# test hello world
|
||||
self.run_test(exe, options=['-c', 'print("hello world!")'],
|
||||
expected=['hello world!'])
|
||||
|
||||
# run hello world
|
||||
output = self.command('-c', 'print("hello world!")',
|
||||
output=str.split, error=str.split)
|
||||
assert output == "hello world!"
|
||||
|
||||
self.command('-c', 'assert False', output=str.split, error=str.split)
|
||||
|
||||
# error = self.command('-c', 'print("Error: failed.")',
|
||||
# output=str.split, error=str.split)
|
||||
|
||||
# assert error.strip() == 'Error: failed.'
|
||||
# check that the executable comes from the spec prefix
|
||||
# also checks imports work
|
||||
self.run_test(exe, options=['-c', 'import sys; print(sys.executable)'],
|
||||
expected=[self.spec.prefix])
|
||||
|
||||
Reference in New Issue
Block a user