

def test__find_in_array_by_regex_object(self):
    'Test searching inside array with regular expression object.'
    bob = {
        'name': 'bob',
        'text': ['abcd', 'cde'],
    }
    sam = {
        'name': 'sam',
        'text': ['bde'],
    }
    self.cmp.do.insert(bob)
    self.cmp.do.insert(sam)
    regex = re.compile('^a')
    regex.cmp.compare_ignore_order.find({
        'text': regex,
    })
    regex = re.compile('e$')
    self.cmp.compare_ignore_order.find({
        'text': regex,
    })
    regex = re.compile('bde|cde')
    self.cmp.compare_ignore_order.find({
        'text': regex,
    })

dataset/ETHPy150Open vmalloc/mongomock/tests/test__mongomock.py MongoClientCollectionTest.test__find_in_array_by_regex_object/VarMisuse@81/129 `self`->`regex`