From 3cbb66b0d9219a6422fdbfd6298a7409f5df51b2 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Thu, 10 Mar 2011 23:35:39 +0200 Subject: [PATCH] Use simpler assert in basic example. --- Doc/library/unittest.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index 77eeaf2c957..5df61554bdd 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -130,13 +130,13 @@ Here is a short script to test three functions from the :mod:`random` module:: def test_choice(self): element = random.choice(self.seq) - self.assertIn(element, self.seq) + self.assertTrue(element in self.seq) def test_sample(self): with self.assertRaises(ValueError): random.sample(self.seq, 20) for element in random.sample(self.seq, 5): - self.assertIn(element, self.seq) + self.assertTrue(element in self.seq) if __name__ == '__main__': unittest.main()