def test_set_tlsext_host_name_wrong_args(self):
    '\n        If `Connection.set_tlsext_host_name` is called with a non-byte string\n        argument or a byte string with an embedded NUL, `TypeError` is raised.\n        '
    conn = Connection(Context(TLSv1_METHOD), None)
    with pytest.raises(TypeError):
        conn.set_tlsext_host_name(object())
    with pytest.raises(TypeError):
        conn.set_tlsext_host_name(b'with\x00null')
    if PY3:
        with pytest.raises(TypeError):
            conn.set_tlsext_host_name(b'example.com'.decode('ascii'))
If `Connection.set_tlsext_host_name` is called with a non-byte string
argument or a byte string with an embedded NUL, `TypeError` is raised.
def test_set_tlsext_host_name_wrong_args(self):
    '\n        If `Connection.set_tlsext_host_name` is called with a non-byte string\n        argument or a byte string with an embedded NUL, `TypeError` is raised.\n        '
    conn = Connection(Context(TLSv1_METHOD), None)
    with pytest.raises(TypeError):
        conn.set_tlsext_host_name(object())
    with pytest.raises(TypeError):
        conn.set_tlsext_host_name(b'with\x00null')
    if PY3:
        with pytest.raises(TypeError):
            conn.set_tlsext_host_name(b'example.com'.decode('ascii'))