__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
import itertools
import operator
import re
# By default, don't filter tests
_test_matchers = ()
_test_patterns = ()
def match_test(test):
# Function used by support.run_unittest() and regrtest --list-cases
result = False
for matcher, result in reversed(_test_matchers):
if matcher(test.id()):
return result
return not result
def _is_full_match_test(pattern):
# If a pattern contains at least one dot, it's considered
# as a full test identifier.
# Example: 'test.test_os.FileTests.test_access'.
#
# ignore patterns which contain fnmatch patterns: '*', '?', '[...]'
# or '[!...]'. For example, ignore 'test_access*'.
return ('.' in pattern) and (not re.search(r'[?*\[\]]', pattern))
def get_match_tests():
global _test_patterns
return _test_patterns
def set_match_tests(patterns):
global _test_matchers, _test_patterns
if not patterns:
_test_matchers = ()
_test_patterns = ()
else:
itemgetter = operator.itemgetter
patterns = tuple(patterns)
if patterns != _test_patterns:
_test_matchers = [
(_compile_match_function(map(itemgetter(0), it)), result)
for result, it in itertools.groupby(patterns, itemgetter(1))
]
_test_patterns = patterns
def _compile_match_function(patterns):
patterns = list(patterns)
if all(map(_is_full_match_test, patterns)):
# Simple case: all patterns are full test identifier.
# The test.bisect_cmd utility only uses such full test identifiers.
return set(patterns).__contains__
else:
import fnmatch
regex = '|'.join(map(fnmatch.translate, patterns))
# The search *is* case sensitive on purpose:
# don't use flags=re.IGNORECASE
regex_match = re.compile(regex).match
def match_test_regex(test_id, regex_match=regex_match):
if regex_match(test_id):
# The regex matches the whole identifier, for example
# 'test.test_os.FileTests.test_access'.
return True
else:
# Try to match parts of the test identifier.
# For example, split 'test.test_os.FileTests.test_access'
# into: 'test', 'test_os', 'FileTests' and 'test_access'.
return any(map(regex_match, test_id.split(".")))
return match_test_regex
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 0 B | 0644 |
|
| cmdline.py | File | 23.32 KB | 0644 |
|
| filter.py | File | 2.4 KB | 0644 |
|
| findtests.py | File | 3.65 KB | 0644 |
|
| logger.py | File | 2.76 KB | 0644 |
|
| main.py | File | 27.13 KB | 0644 |
|
| mypy.ini | File | 800 B | 0644 |
|
| pgo.py | File | 1.35 KB | 0644 |
|
| refleak.py | File | 9.55 KB | 0644 |
|
| result.py | File | 7.45 KB | 0644 |
|
| results.py | File | 9.58 KB | 0644 |
|
| run_workers.py | File | 22.3 KB | 0644 |
|
| runtests.py | File | 7.02 KB | 0644 |
|
| save_env.py | File | 12.74 KB | 0644 |
|
| setup.py | File | 4.98 KB | 0644 |
|
| single.py | File | 10.61 KB | 0644 |
|
| testresult.py | File | 6.2 KB | 0644 |
|
| tsan.py | File | 849 B | 0644 |
|
| utils.py | File | 24.12 KB | 0644 |
|
| win_utils.py | File | 4.56 KB | 0644 |
|
| worker.py | File | 3.57 KB | 0644 |
|