Verify Python version >= 2.6 before running context manager test

This commit is contained in:
Michael Williamson 2013-01-05 00:05:58 +00:00
parent 602250fdf9
commit 0b6aebb8a9
1 changed files with 4 additions and 0 deletions

View File

@ -192,6 +192,10 @@ class SFTPTest (unittest.TestCase):
""" """
verify that an opened file can be used as a context manager verify that an opened file can be used as a context manager
""" """
major, minor, micro, releaselevel, serial = sys.version_info
if (major, minor) <= (2, 5):
return
try: try:
with sftp.open(FOLDER + '/duck.txt', 'w') as f: with sftp.open(FOLDER + '/duck.txt', 'w') as f:
f.write(ARTICLE) f.write(ARTICLE)