You've already forked fuzzysearch
mirror of
https://github.com/Dasharo/fuzzysearch.git
synced 2026-03-06 15:27:05 -08:00
25 lines
753 B
Python
25 lines
753 B
Python
from functools import wraps
|
|
from six import text_type
|
|
|
|
|
|
def skip_if_arguments_arent_byteslike(test_method):
|
|
@wraps(test_method)
|
|
def new_method(self, *args, **kwargs):
|
|
subsequence, sequence = args[:2]
|
|
if (
|
|
isinstance(subsequence, text_type) or
|
|
isinstance(sequence, text_type)
|
|
):
|
|
raise self.skipTest(
|
|
"skipping test with unicode data for byteslike function")
|
|
elif (
|
|
isinstance(subsequence, (list, tuple)) or
|
|
isinstance(sequence, (list, tuple))
|
|
):
|
|
raise self.skipTest(
|
|
"skipping test with list/tuple data for byteslike function")
|
|
|
|
return test_method(self, *args, **kwargs)
|
|
|
|
return new_method
|