def test_nonStringName(self):
        """
        When constructed with a name which is neither C{bytes} nor C{str},
        L{Name} raises L{TypeError}.
        """
        self.assertRaises(TypeError, dns.Name, 123)
        self.assertRaises(TypeError, dns.Name, object())
        self.assertRaises(TypeError, dns.Name, [])

        When constructed with a name which is neither C{bytes} nor C{str},
        L{Name} raises L{TypeError}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/names/test/test_dns.py