コード例 #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()
コード例 #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()
コード例 #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()
コード例 #4
0
def mocker(pytestconfig):
    result = MockFixture(pytestconfig)
    yield result
    result.stopall()
コード例 #5
0
def mocker_context():
    result = MockFixture(FakePytestConfig())
    yield result
    result.stopall()
コード例 #6
0
ファイル: mock.py プロジェクト: woakes070048/pretix
def mocker_context():
    result = MockFixture()
    yield result
    result.stopall()
コード例 #7
0
ファイル: mock.py プロジェクト: FlaviaBastos/pretix
def mocker_context():
    result = MockFixture(FakePytestConfig())
    yield result
    result.stopall()