Skip to content

Commit f38382c

Browse files
committed
Fix test_substring_attribute_complete
Classes in Python 3.x have a __prepare__ method, so substring matching finds two methods for 'ar'.
1 parent 7031c4d commit f38382c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bpython/test/test_repl.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -300,17 +300,17 @@ def test_simple_attribute_complete(self):
300300

301301
def test_substring_attribute_complete(self):
302302
self.repl = FakeRepl({'autocomplete_mode': autocomplete.SUBSTRING})
303-
self.repl.input_line = "Foo.ar"
304-
self.repl.current_word = "Foo.ar"
303+
self.repl.input_line = "Foo.az"
304+
self.repl.current_word = "Foo.az"
305305

306-
code = "class Foo():\n\tdef bar(self):\n\t\tpass\n"
306+
code = "class Foo():\n\tdef baz(self):\n\t\tpass\n"
307307
for line in code.split("\n"):
308308
self.repl.push(line)
309309

310310
self.assertTrue(self.repl.complete())
311311
self.assertTrue(hasattr(self.repl.completer,'matches'))
312312
self.assertEqual(self.repl.completer.matches,
313-
['Foo.bar'])
313+
['Foo.baz'])
314314

315315
def test_fuzzy_attribute_complete(self):
316316
self.repl = FakeRepl({'autocomplete_mode': autocomplete.FUZZY})

0 commit comments

Comments
 (0)