Cleanup: move copy-paste code into function

This commit is contained in:
2017-06-19 16:12:11 +10:00
parent 9649c6bef5
commit 2ecb9856bc
112 changed files with 124 additions and 666 deletions

View File

@@ -783,3 +783,15 @@ class Clay:
self._update()
self._properties[name].use(data_path)
setattr(self._properties[name], data_path, value)
def setup_extra_arguments(filepath):
"""
Create a value which is assigned to: ``UnitTesting._extra_arguments``
"""
import sys
extra_arguments = sys.argv[sys.argv.index("--") + 1:] if "--" in sys.argv else []
sys.argv = [filepath] + extra_arguments[1:]
return extra_arguments