for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# pylint: disable=unused-variable,expression-not-assigned,singleton-comparison
from mock import patch, Mock
mock
This can be caused by one of the following:
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
# .scrutinizer.yml before_commands: - sudo pip install abc # Python2 - sudo pip3 install abc # Python3
This error could also result from missing __init__.py files in your module folders. Make sure that you place one file in each sub-folder.
__init__.py
from expecter import expect
expecter
from coveragespace import cli
def describe_call():
@patch('coveragespace.cache.Cache.get', Mock())
def it_handles_invalid_response():
expect(cli.call('slug', 'metric', 42)) == False
@patch('coveragespace.cache.Cache.get', Mock(return_value=None))
@patch('coveragespace.cache.Cache.set', Mock(return_value=None))
@patch('time.sleep', Mock())
@patch('requests.put')
def it_retries_500s(requests_put):
requests_put.return_value = Mock(status_code=500)
cli.call('slug', 'metric', 42)
expect(requests_put.call_count) == 3