Match test requirements by full package name. (#9764)

pull/7358/merge
Andrey 2017-10-09 06:49:51 +03:00 committed by Paulus Schoutsen
parent b620c433c0
commit 2a2ee81957
1 changed files with 9 additions and 7 deletions

View File

@ -40,7 +40,6 @@ TEST_REQUIREMENTS = (
'ephem', 'ephem',
'evohomeclient', 'evohomeclient',
'feedparser', 'feedparser',
'forecastio',
'fuzzywuzzy', 'fuzzywuzzy',
'gTTS-token', 'gTTS-token',
'ha-ffmpeg', 'ha-ffmpeg',
@ -51,15 +50,16 @@ TEST_REQUIREMENTS = (
'libpurecoollink', 'libpurecoollink',
'libsoundtouch', 'libsoundtouch',
'mficlient', 'mficlient',
'nx584', 'paho-mqtt',
'paho',
'pexpect', 'pexpect',
'pilight', 'pilight',
'pmsensor', 'pmsensor',
'prometheus_client', 'prometheus_client',
'pydispatch', 'pydispatcher',
'PyJWT', 'PyJWT',
'pylitejet', 'pylitejet',
'pynx584',
'python-forecastio',
'pyunifi', 'pyunifi',
'pywebpush', 'pywebpush',
'restrictedpython', 'restrictedpython',
@ -201,11 +201,13 @@ def requirements_test_output(reqs):
output = [] output = []
output.append('# Home Assistant test') output.append('# Home Assistant test')
output.append('\n') output.append('\n')
with open('requirements_test.txt') as fp: with open('requirements_test.txt') as test_file:
output.append(fp.read()) output.append(test_file.read())
output.append('\n') output.append('\n')
filtered = {key: value for key, value in reqs.items() filtered = {key: value for key, value in reqs.items()
if any(ign in key for ign in TEST_REQUIREMENTS)} if any(
re.search(r'(^|#){}($|[=><])'.format(ign),
key) is not None for ign in TEST_REQUIREMENTS)}
output.append(generate_requirements_list(filtered)) output.append(generate_requirements_list(filtered))
return ''.join(output) return ''.join(output)