def test_write_num():
    ser = Serial()
    with pytest.raises(TypeError):
        ser.write(1)
def test_write_str():
    ser = Serial()
    ser.write('abc')
    ser.close()