Skip to content

Commit f019f3d

Browse files
committed
Use testtools.SkipIf instead so that secrets mocking isn't broken for python 3.5.
1 parent b9c7595 commit f019f3d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/CLI/modules/user_tests.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"""
77
import json
88
import sys
9+
import unittest
910

1011
import mock
1112

@@ -167,12 +168,10 @@ def test_create_user_no_confirm(self, confirm_mock):
167168
result = self.run_command(['user', 'create', 'test', '-e', '[email protected]', '-p', 'testword'])
168169
self.assertEqual(result.exit_code, 2)
169170

171+
@unittest.SkipIf(sys.version_info < (3, 6), "Secrets module only exists in version 3.6+")
170172
@mock.patch('secrets.choice')
171173
@mock.patch('SoftLayer.CLI.formatting.confirm')
172174
def test_create_user_generate_password_36(self, confirm_mock, secrets):
173-
if sys.version_info < (3, 6):
174-
self.skipTest("Secrets module only exists in version 3.6+")
175-
176175
secrets.return_value = 'Q'
177176
confirm_mock.return_value = True
178177
result = self.run_command(['user', 'create', 'test', '-e', '[email protected]', '-p', 'generate'])

0 commit comments

Comments
 (0)