mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-08 23:04:48 +08:00
Fixed some minor mocking differences in Python 2 and 3.
This commit is contained in:
@@ -60,12 +60,14 @@ def test_carriage_return_splitting():
|
|||||||
|
|
||||||
|
|
||||||
def test_split_parts():
|
def test_split_parts():
|
||||||
def splits(source):
|
cache.parser_cache.pop(None, None)
|
||||||
class Obj(object):
|
|
||||||
_keyword_re = FastParser._keyword_re
|
|
||||||
number_of_splits = True
|
|
||||||
|
|
||||||
return tuple(FastParser._split_parts(Obj(), source))
|
def splits(source):
|
||||||
|
class Mock(FastParser):
|
||||||
|
def __init__(self, *args):
|
||||||
|
self.number_of_splits = 0
|
||||||
|
|
||||||
|
return tuple(FastParser._split_parts(Mock(None, None), source))
|
||||||
|
|
||||||
def test(*parts):
|
def test(*parts):
|
||||||
assert splits(''.join(parts)) == parts
|
assert splits(''.join(parts)) == parts
|
||||||
|
|||||||
Reference in New Issue
Block a user