From a0e25aec007a36eaea8d5bc2ea7d43ade1293328 Mon Sep 17 00:00:00 2001 From: Paul Tremberth Date: Mon, 20 Jan 2014 17:29:16 +0100 Subject: [PATCH] Use assertTrue/False --- scrapy/tests/test_selector.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/scrapy/tests/test_selector.py b/scrapy/tests/test_selector.py index 27f10a2b5..489a163a0 100644 --- a/scrapy/tests/test_selector.py +++ b/scrapy/tests/test_selector.py @@ -322,23 +322,15 @@ class SelectorTestCase(unittest.TestCase): # only when smart_strings are on x = self.sscls(response) li_text = x.xpath('//li/text()') - self.assertIs( - any(map(lambda e: hasattr(e._root, 'getparent'), li_text)), - False) + self.assertFalse(any(map(lambda e: hasattr(e._root, 'getparent'), li_text))) div_class = x.xpath('//div/@class') - self.assertIs( - any(map(lambda e: hasattr(e._root, 'getparent'), div_class)), - False) + self.assertFalse(any(map(lambda e: hasattr(e._root, 'getparent'), div_class))) x = SmartStringsSelector(response) li_text = x.xpath('//li/text()') - self.assertIs( - all(map(lambda e: hasattr(e._root, 'getparent'), li_text)), - True) + self.assertTrue(all(map(lambda e: hasattr(e._root, 'getparent'), li_text))) div_class = x.xpath('//div/@class') - self.assertIs( - all(map(lambda e: hasattr(e._root, 'getparent'), div_class)), - True) + self.assertTrue(all(map(lambda e: hasattr(e._root, 'getparent'), div_class))) class DeprecatedXpathSelectorTest(unittest.TestCase):