Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5df09e4

Browse files
fix three last failing tests
1 parent0f6ce9c commit5df09e4

File tree

4 files changed

+9
-4
lines changed

4 files changed

+9
-4
lines changed

‎bpython/line.py‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,13 @@ def current_dict(cursor_offset, line):
3838
returnNone
3939

4040
defcurrent_string(cursor_offset,line):
41-
"""If inside a string, return the string (excluding quotes)
41+
"""If inside a string of nonzero length, return the string (excluding quotes)
4242
4343
Weaker than bpython.Repl's current_string, because that checks that a string is a string
4444
based on previous lines in the buffer"""
45-
forminre.finditer('''(?P<open>(?:""")|"|(?:''\')|')(?:((?P<closed>.*?)(?P=open))|(?P<unclosed>.*))''',line):
45+
forminre.finditer('''(?P<open>(?:""")|"|(?:''\')|')(?:((?P<closed>.+?)(?P=open))|(?P<unclosed>.+))''',line):
4646
i=3ifm.group(3)else4
47-
ifm.start(i)<cursor_offsetandm.end(i)>=cursor_offset:
47+
ifm.start(i)<=cursor_offsetandm.end(i)>=cursor_offset:
4848
returnm.start(i),m.end(i),m.group(i)
4949
returnNone
5050

‎bpython/test/test_keys.py‎

100755100644
File mode changed.

‎bpython/test/test_line_properties.py‎

100755100644
File mode changed.

‎bpython/test/test_repl.py‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
defskip(f):
99
returnlambdaself:None
1010

11+
py3= (sys.version_info[0]==3)
12+
1113
frombpythonimportconfig,repl,cli,autocomplete
1214

1315
defsetup_config(conf):
@@ -399,7 +401,10 @@ def setUp(self):
399401
# 3 Types of tab complete
400402
deftest_simple_tab_complete(self):
401403
self.repl.matches_iter=MagicMock()
402-
self.repl.matches_iter.__nonzero__.return_value=False
404+
ifpy3:
405+
self.repl.matches_iter.__bool__.return_value=False
406+
else:
407+
self.repl.matches_iter.__nonzero__.return_value=False
403408
self.repl.complete=Mock()
404409
self.repl.print_line=Mock()
405410
self.repl.matches_iter.is_cseq.return_value=False

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp