TST: skip test with optional files if not existing

pull/111/head
Sebastian Wagner 2017-09-20 11:15:33 +02:00
parent d59e70ce84
commit 0790e571a1
No known key found for this signature in database
GPG Key ID: 4BB5A67FBECFA8A5
1 changed files with 6 additions and 3 deletions

View File

@ -233,9 +233,12 @@ class TestOffline(unittest.TestCase):
def test_objects(self, m):
paths = ['cmd.exe', 'tmux', 'MachO-OSX-x64-ls']
for path in paths:
json_blob = self.make_objects(os.path.join('tests',
'viper-test-files', 'test_files', path))
try:
for path in paths:
json_blob = self.make_objects(os.path.join('tests',
'viper-test-files', 'test_files', path))
except IOError: # Can be replaced with FileNotFoundError when support for python 2 is dropped
return unittest.SkipTest()
print(json_blob)
if __name__ == '__main__':