

def test_all(self):
    domain = ['alfa', 'bravo', 'charlie', 'delta', 'echo', 'foxtrot']
    schema = Schema(text=TEXT)
    storage = RamStorage()
    ix = storage.create_index(schema)
    w = ix.writer()
    for _ in xrange(100):
        w.add_document(text=' '.join((choice(domain) for i in xrange(randint(10, 20)))))
    w.commit()
    init_args = {
        'MultiWeighting': ([scoring.BM25F()], {
            'text': scoring.Frequency(),
        }),
    }
    reader = _.reader()
    for wclass in self._weighting_classes():
        if (wclass.__name__ in init_args):
            (args, kwargs) = init_args[wclass.__name__]
            weighting = wclass(*args, **kwargs)
        else:
            weighting = wclass()
        searcher = Searcher(reader, weighting)
        for word in domain:
            r = searcher.search(query.Term('text', word))

dataset/ETHPy150Open dokipen/whoosh/tests/test_weightings.py TestWeightings.test_all/VarMisuse@140/179 `ix`->`_`