Commits

Sebastian Ramacher committed 90e21a5

Fix test_substring_attribute_complete

Classes in Python 3.x have a __prepare__ method, so substring matching finds two
methods for 'ar'.

  • Participants
  • Parent commits ee703b2

Comments (0)

Files changed (1)

bpython/test/test_repl.py

 
     def test_substring_attribute_complete(self):
         self.repl = FakeRepl({'autocomplete_mode': autocomplete.SUBSTRING})
-        self.repl.input_line = "Foo.ar"
-        self.repl.current_word = "Foo.ar"
+        self.repl.input_line = "Foo.az"
+        self.repl.current_word = "Foo.az"
 
-        code = "class Foo():\n\tdef bar(self):\n\t\tpass\n"
+        code = "class Foo():\n\tdef baz(self):\n\t\tpass\n"
         for line in code.split("\n"):
             self.repl.push(line)
 
         self.assertTrue(self.repl.complete())
         self.assertTrue(hasattr(self.repl.completer,'matches'))
         self.assertEqual(self.repl.completer.matches,
-            ['Foo.bar'])
+            ['Foo.baz'])
 
     def test_fuzzy_attribute_complete(self):
         self.repl = FakeRepl({'autocomplete_mode': autocomplete.FUZZY})