1
0
mirror of https://github.com/nvbn/thefuck.git synced 2024-10-05 18:31:10 +01:00
thefuck/tests/test_logs.py

20 lines
478 B
Python
Raw Normal View History

2015-09-07 10:12:16 +01:00
import pytest
2015-04-22 05:03:06 +01:00
from thefuck import logs
2015-09-07 10:12:16 +01:00
def test_color(settings):
settings.no_colors = False
assert logs.color('red') == 'red'
settings.no_colors = True
assert logs.color('red') == ''
2015-07-15 05:47:54 +01:00
2015-09-07 10:12:16 +01:00
@pytest.mark.usefixtures('no_colors')
@pytest.mark.parametrize('debug, stderr', [
(True, 'DEBUG: test\n'),
(False, '')])
def test_debug(capsys, settings, debug, stderr):
settings.debug = debug
logs.debug('test')
assert capsys.readouterr() == ('', stderr)