def test_isatty_random_obj(orig_isatty): assert not termui.isatty([1, 2, 3])
def test_isatty_tty(fake_tty, orig_isatty): assert termui.isatty(fake_tty)
def test_isatty_file(tmpfolder, orig_isatty): file = tmpfolder.join('file.txt').ensure().open() assert not termui.isatty(file)
def test_isatty_buffer(orig_isatty): assert not termui.isatty(StringIO())
def test_isatty_file(tmpfolder, orig_isatty): file = tmpfolder.join("file.txt").ensure().open() assert not termui.isatty(file)
def test_isatty_stdout_stderr(capsys, orig_isatty): with capsys.disabled(): assert termui.isatty(sys.stdout) assert termui.isatty(sys.stderr)