Exemple #1
0
def test_markup_detection_tty_yes(mocker: MockFixture) -> None:
    """Assures TERM=xterm enables markup."""
    mocker.patch("sys.stdout.isatty", return_value=True)
    mocker.patch("os.environ", {"TERM": "xterm"})
    assert should_do_markup()
    mocker.resetall()
    mocker.stopall()
Exemple #2
0
def test_markup_detection_tty_no(mocker: MockFixture) -> None:
    """Assures that if no tty is reported we disable markup."""
    mocker.patch("os.environ", {})
    mocker.patch("sys.stdout.isatty", return_value=False)
    assert not should_do_markup()
    mocker.resetall()
    mocker.stopall()
Exemple #3
0
def set_default_config(pytestconfig):
    mocker = MockFixture(pytestconfig)

    mocker.patch.object(config.IniConfigMixin, 'DEFAULT_CONFIG_PATH')
    config.IniConfigMixin.DEFAULT_CONFIG_PATH.return_value = str(
        Path(__file__) / 'configs' / 'non-premium.config')

    yield
    mocker.stopall()
Exemple #4
0
def mocker(pytestconfig):
    result = MockFixture(pytestconfig)
    yield result
    result.stopall()
Exemple #5
0
def mocker_context():
    result = MockFixture(FakePytestConfig())
    yield result
    result.stopall()
Exemple #6
0
def mocker_context():
    result = MockFixture()
    yield result
    result.stopall()
Exemple #7
0
def mocker_context():
    result = MockFixture(FakePytestConfig())
    yield result
    result.stopall()