Add reproduce state template (#26866)

* Add reproduce state template

* Handle invalid state
This commit is contained in:
Paulus Schoutsen 2019-09-23 23:23:53 -07:00 committed by GitHub
parent 6fe5582c6a
commit 53e6b8ade6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 155 additions and 4 deletions

View file

@ -4,7 +4,7 @@ from pathlib import Path
import subprocess
import sys
from . import gather_info, generate, error
from . import gather_info, generate, error, docs
from .const import COMPONENT_DIR
@ -65,9 +65,11 @@ def main():
print()
print("Running tests")
print(f"$ pytest tests/components/{info.domain}")
print(f"$ pytest -v tests/components/{info.domain}")
if (
subprocess.run(f"pytest tests/components/{info.domain}", shell=True).returncode
subprocess.run(
f"pytest -v tests/components/{info.domain}", shell=True
).returncode
!= 0
):
return 1
@ -75,6 +77,8 @@ def main():
print(f"Done!")
docs.print_relevant_docs(args.template, info)
return 0