Commits

Matt Chaput committed c07511b

Minor fixes to unit tests for Python 2.5.

  • Participants
  • Parent commits daf551d

Comments (0)

Files changed (2)

tests/test_parse_plugins.py

     with ix.writer() as w:
         # Match -> first
         w.add_document(title=u("First"),
-                       content=u"This is the first document we've added!")
+                       content=u("This is the first document we've added!"))
         # No match
         w.add_document(title=u("Second"),
                        content=u("The second one is even more interesting! filst"))
 
     with ix.searcher(weighting=scoring.TF_IDF()) as searcher:
         results = searcher.search(q)
-        print(len(results))
         assert len(results) == 4
         assert " ".join(hit["title"] for hit in results) == "Fourth First Third Fifth"
 

tests/test_parsing.py

 
 def test_unicode_num():
     schema = fields.Schema(num=fields.NUMERIC)
-    parser = default.QueryParser(u"num", schema=schema)
-    q = parser.parse(u"num:1")
+    parser = default.QueryParser(u("num"), schema=schema)
+    q = parser.parse(u("num:1"))
 
     _ = text_type(q)
 
 def test_phrase_boost():
     qp = default.QueryParser("f", None)
     q = qp.parse(u('Dahmen ANDMAYBE "Besov Spaces"^9'))
-    print(q.__unicode__())
     assert isinstance(q, query.AndMaybe)
     assert q[0] == query.Term("f", u("Dahmen"))
     assert q[1] == query.Phrase("f", [u("Besov"), u("Spaces")], boost=9)