diff --git a/script/check_dirty b/script/check_dirty new file mode 100755 index 0000000000000..94db657a542db --- /dev/null +++ b/script/check_dirty @@ -0,0 +1,7 @@ +#!/bin/bash +[[ -z $(git ls-files --others --exclude-standard) ]] && exit 0 + +echo -e '\n***** ERROR\nTests are leaving files behind. Please update the tests to avoid writing any files:' +git ls-files --others --exclude-standard +echo +exit 1 diff --git a/tox.ini b/tox.ini index 60dacd5d8cb02..dcfb209ef3a9c 100644 --- a/tox.ini +++ b/tox.ini @@ -13,6 +13,7 @@ whitelist_externals = /usr/bin/env install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages} commands = pytest --timeout=9 --duration=10 {posargs} + {toxinidir}/script/check_dirty deps = -r{toxinidir}/requirements_test_all.txt -c{toxinidir}/homeassistant/package_constraints.txt @@ -29,6 +30,7 @@ whitelist_externals = /usr/bin/env install_command = /usr/bin/env LANG=C.UTF-8 pip install {opts} {packages} commands = pytest --timeout=9 --duration=10 --cov --cov-report= {posargs} + {toxinidir}/script/check_dirty deps = -r{toxinidir}/requirements_test_all.txt -c{toxinidir}/homeassistant/package_constraints.txt