2015-07-10 17:58:41 +03:00
|
|
|
import pytest
|
2015-09-01 12:51:41 +03:00
|
|
|
from mock import Mock
|
2015-07-10 17:58:41 +03:00
|
|
|
|
|
|
|
|
2015-09-06 01:13:44 +03:00
|
|
|
def pytest_addoption(parser):
|
|
|
|
"""Adds `--run-without-docker` argument."""
|
|
|
|
group = parser.getgroup("thefuck")
|
|
|
|
group.addoption('--enable-functional', action="store_true", default=False,
|
|
|
|
help="Enable functional tests")
|
|
|
|
|
|
|
|
|
2015-07-10 17:58:41 +03:00
|
|
|
@pytest.fixture
|
|
|
|
def no_memoize(monkeypatch):
|
|
|
|
monkeypatch.setattr('thefuck.utils.memoize.disabled', True)
|
2015-09-01 12:51:41 +03:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture
|
|
|
|
def settings():
|
|
|
|
return Mock(debug=False, no_colors=True)
|
2015-09-02 11:10:03 +03:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def no_cache(monkeypatch):
|
|
|
|
monkeypatch.setattr('thefuck.utils.cache.disabled', True)
|
2015-09-06 01:13:44 +03:00
|
|
|
|
|
|
|
|
|
|
|
@pytest.fixture(autouse=True)
|
|
|
|
def functional(request):
|
|
|
|
if request.node.get_marker('functional') \
|
|
|
|
and not request.config.getoption('enable_functional'):
|
|
|
|
pytest.skip('functional tests are disabled')
|