From 2d9c644ab6478f3c3e0219b5a155aa313cf5088c Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Thu, 5 Feb 2015 01:25:53 +0100 Subject: [PATCH] Fixed some minor mocking differences in Python 2 and 3. --- test/test_parser/test_fast_parser.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/test_parser/test_fast_parser.py b/test/test_parser/test_fast_parser.py index 07bca91a..01d4dfd3 100644 --- a/test/test_parser/test_fast_parser.py +++ b/test/test_parser/test_fast_parser.py @@ -60,12 +60,14 @@ def test_carriage_return_splitting(): def test_split_parts(): - def splits(source): - class Obj(object): - _keyword_re = FastParser._keyword_re - number_of_splits = True + cache.parser_cache.pop(None, None) - 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): assert splits(''.join(parts)) == parts