コード例 #1
0
 def test_no_contextlib_nested(self):
     self.assertEqual(1, len(list(checks.check_no_contextlib_nested(
         "with contextlib.nested("))))
     self.assertEqual(1, len(list(checks.check_no_contextlib_nested(
         "  with nested("))))
     self.assertEqual(0, len(list(checks.check_no_contextlib_nested(
         "with my.nested("))))
     self.assertEqual(0, len(list(checks.check_no_contextlib_nested(
         "with foo as bar"))))
コード例 #2
0
 def test_no_contextlib_nested(self):
     self.assertEqual(1, len(list(checks.check_no_contextlib_nested(
         "with contextlib.nested("))))
     self.assertEqual(1, len(list(checks.check_no_contextlib_nested(
         "  with nested("))))
     self.assertEqual(0, len(list(checks.check_no_contextlib_nested(
         "with my.nested("))))
     self.assertEqual(0, len(list(checks.check_no_contextlib_nested(
         "with foo as bar"))))