diff --git a/awslimitchecker/tests/test_version.py b/awslimitchecker/tests/test_version.py index 8ade282c..3f8873ad 100644 --- a/awslimitchecker/tests/test_version.py +++ b/awslimitchecker/tests/test_version.py @@ -80,6 +80,8 @@ def test__get_version_info(self): assert v.tag == 'foobar' assert mock_ver.mock_calls == [call('awslimitchecker')] + @pytest.mark.skipif(sys.version_info[0:2] == (3, 2), + reason='versionfinder doesnt work on py32') def test__get_version_info_fallback(self): def se(foo): raise Exception("foo") @@ -98,6 +100,17 @@ def se(foo): ' may not be in compliance with the AGPLv3 license:') ] + @pytest.mark.skipif(sys.version_info[0:2] != (3, 2), + reason='py32 versionfinder test') + def test__get_version_info_py32(self): + with patch('awslimitchecker.version.logger') as mock_logger: + with pytest.raises(ImportError): + version._get_version_info() + assert mock_logger.mock_calls == [ + call.exception('Error checking installed version; this installation' + ' may not be in compliance with the AGPLv3 license:') + ] + def test_is_semver(self): # see: # https://github.com/mojombo/semver.org/issues/59#issuecomment-57884619