@scenario(prepare_data, cleanup_data)
def test_search_with_scoring_and_lang(context):
    # When create a query block
    t = QuerySet("localhost", index="foo")

    # And there are records
    add_document("foo", {"bar": 1})
    add_document("foo", {"bar": 2})
    add_document("foo", {"bar": 3})

    # And I add scoring with a language
    score = ScriptScore("s = 0 + doc['bar'].value", lang="mvel")
    t.score(score)
    results = t[0:10]

    # Then my results are scored correctly
    len(results).should.equal(3)
    results[0]["_source"]["bar"].should.equal(3)
    results[1]["_source"]["bar"].should.equal(2)
    results[2]["_source"]["bar"].should.equal(1)
Apply syntax highlighting to a single substring from a doctest
dataset/ETHPy150Open Yipit/pyeqs/tests/functional/test_score.py/test_search_with_scoring_and_lang--crossover with--dataset/ETHPy150Open QuantSoftware/QuantSoftwareToolkit/Legacy/epydoc-3.0.1/epydoc/markup/doctest.py/DoctestColorizer.markup