def test_nonFloat(self):
        """
        L{amp.Float.toString} raises L{ValueError} if passed an object which
        is not a L{float}.
        """
        argument = amp.Float()
        self.assertRaises(ValueError, argument.toString, u"1.234")
        self.assertRaises(ValueError, argument.toString, b"1.234")
        self.assertRaises(ValueError, argument.toString, 1234)

        L{amp.Float.toString} raises L{ValueError} if passed an object which
        is not a L{float}.
        
stackoverflow/venv/lib/python3.6/site-packages/twisted/test/test_amp.py