Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(4)  |  Derive(0)  |  Import(0)
Just like self.assertTrue(a in b), but with a nicer default message.

src/p/y/pyjs-HEAD/examples/libtest/ListTest.py   pyjs(Download)
        except ValueError, e:
            print '[%s]' % str(e)
            self.assertIn(str(e), [
                "list.index(x): x not in list", # <= 2.6
                "200000 is not in list", # <= 2.6

src/p/y/pyjs-HEAD/examples/libtest/BuiltinTest.py   pyjs(Download)
            self.fail("No float('not float') argument error raised")
        except ValueError, e:
            self.assertIn(e[0], [
                "invalid literal for float(): not float", # <= 2.6
                "could not convert string to float: not float", # 2.7
            self.fail("No float('') argument error raised")
        except ValueError, e:
            self.assertIn(e[0], [
                "empty string for float()", # <= 2.6
                "could not convert string to float: ", # 2.7
            self.fail("No float(' ') argument error raised")
        except ValueError, e:
            self.assertIn(e[0], [
                "empty string for float()", # <= 2.6
                "could not convert string to float: ", # 2.7