예제 #1
0
def test_isatty_random_obj(orig_isatty):
    assert not termui.isatty([1, 2, 3])
예제 #2
0
def test_isatty_tty(fake_tty, orig_isatty):
    assert termui.isatty(fake_tty)
예제 #3
0
def test_isatty_file(tmpfolder, orig_isatty):
    file = tmpfolder.join('file.txt').ensure().open()
    assert not termui.isatty(file)
예제 #4
0
def test_isatty_buffer(orig_isatty):
    assert not termui.isatty(StringIO())
예제 #5
0
def test_isatty_tty(fake_tty, orig_isatty):
    assert termui.isatty(fake_tty)
예제 #6
0
def test_isatty_random_obj(orig_isatty):
    assert not termui.isatty([1, 2, 3])
예제 #7
0
def test_isatty_buffer(orig_isatty):
    assert not termui.isatty(StringIO())
예제 #8
0
def test_isatty_file(tmpfolder, orig_isatty):
    file = tmpfolder.join("file.txt").ensure().open()
    assert not termui.isatty(file)
예제 #9
0
def test_isatty_stdout_stderr(capsys, orig_isatty):
    with capsys.disabled():
        assert termui.isatty(sys.stdout)
        assert termui.isatty(sys.stderr)