Fix skipping test when boto is not installed

When boto and moto are not installed, the BotoVpcTestCaseBase() should
be skipped. _get_boto_version() and _get_moto_version() require that
boto and moto are installed, but are called anyway in the skipIf
condition.
This commit is contained in:
Benjamin Drung 2018-01-23 13:32:22 +01:00
parent 2b9b262357
commit 76d44e9490

View file

@ -132,8 +132,9 @@ def _has_required_moto():
@skipIf(HAS_MOTO is False, 'The moto module must be installed.')
@skipIf(_has_required_boto() is False, 'The boto module must be greater than'
' or equal to version {}. Installed: {}'
.format(required_boto_version, _get_boto_version()))
@skipIf(_has_required_moto() is False, 'The moto version must be >= to version {}. Installed: {}'.format(required_moto_version, _get_moto_version()))
.format(required_boto_version, _get_boto_version() if HAS_BOTO else 'None'))
@skipIf(_has_required_moto() is False, 'The moto version must be >= to version {}. Installed: {}'
.format(required_moto_version, _get_moto_version() if HAS_MOTO else 'None'))
class BotoVpcTestCaseBase(TestCase, LoaderModuleMockMixin):
conn3 = None