for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
# pylint: disable=unused-variable,redefined-outer-name,expression-not-assigned
import os
from unittest.mock import patch, call
import pytest
from expecter import expect
expecter
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 gitman import cli
@pytest.fixture
def config(tmpdir):
tmpdir.chdir()
path = str(tmpdir.join("gdm.yml"))
open(path, 'w').close()
return path
def location(tmpdir):
with open(path, 'w') as outfile:
outfile.write("location: foo")
return str(tmpdir.join("foo"))
def describe_show():
@patch('gitman.common.show')
def it_prints_location_by_default(show, location):
cli.main(['show'])
expect(show.mock_calls) == [call(location)]
def it_can_print_a_depenendcy_path(show, location):
cli.main(['show', 'bar'])
expect(show.mock_calls) == [call(os.path.join(location, "bar"))]
def describe_edit():
@patch('gitman.system.launch')
def it_launches_the_config(launch, config):
cli.main(['edit'])
expect(launch.mock_calls) == [call(config), call().__bool__()]
def it_exits_when_no_config_found(tmpdir):
with expect.raises(SystemExit):
This can be caused by one of the following:
1. Missing Dependencies
This error could indicate a configuration issue of Pylint. Make sure that your libraries are available by adding the necessary commands.
2. Missing __init__.py files
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.