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()
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()
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()
def mocker(pytestconfig): result = MockFixture(pytestconfig) yield result result.stopall()
def mocker_context(): result = MockFixture(FakePytestConfig()) yield result result.stopall()
def mocker_context(): result = MockFixture() yield result result.stopall()