Use the correct python version in tests.

This commit is contained in:
Holger Rapp 2014-02-14 08:22:09 +01:00
parent c137922918
commit 5aca4a6952

View File

@ -229,6 +229,9 @@ class _VimTest(unittest.TestCase):
with tempfile.NamedTemporaryFile( with tempfile.NamedTemporaryFile(
prefix="UltiSnips_Python", suffix=".py", delete=False prefix="UltiSnips_Python", suffix=".py", delete=False
) as temporary_file: ) as temporary_file:
if sys.version_info >= (3,0):
s = s.encode("utf-8")
temporary_file.write(s) temporary_file.write(s)
temporary_file.close() temporary_file.close()
@ -3154,6 +3157,10 @@ if __name__ == '__main__':
vim.send(""":let g:UltiSnipsJumpForwardTrigger="?"\n""") vim.send(""":let g:UltiSnipsJumpForwardTrigger="?"\n""")
vim.send(""":let g:UltiSnipsJumpBackwardTrigger="+"\n""") vim.send(""":let g:UltiSnipsJumpBackwardTrigger="+"\n""")
vim.send(""":let g:UltiSnipsListSnippets="@"\n""") vim.send(""":let g:UltiSnipsListSnippets="@"\n""")
if sys.version_info >= (3,0):
vim.send(""":let g:UltiSnipsUsePythonVersion="3"\n""")
else:
vim.send(""":let g:UltiSnipsUsePythonVersion="2"\n""")
# Now, source our runtime # Now, source our runtime
vim.send(":so plugin/UltiSnips.vim\n") vim.send(":so plugin/UltiSnips.vim\n")