예제 #1
0
 def test_category_nomatch(self, category):
     sub = _substitution_with_span(0, 2, category=category)
     self.assertEqual(
         list(
             substitution.suppress_exclude_bytes([sub],
                                                 {'foo.bar': [(0, 2)]})),
         [sub])
예제 #2
0
 def find_iter_parsed(
     self, parsed: _matcher.PythonParsedFile
 ) -> Iterable[substitution.Substitution]:
     return substitution.suppress_exclude_bytes(
         self.searcher.find_iter_parsed(parsed),
         _pragma_excluded_ranges(parsed),
     )
예제 #3
0
 def test_intersect(self, start, end):
     sub = _substitution_with_span(start, end)
     self.assertEqual(
         list(substitution.suppress_exclude_bytes([sub], {None: [(1, 6)]})),
         [])