PY-29497: Do not provide sys.argv[1:] to behave since they are already provided

_jb_django_behave.py:
"scenario_n_options" already contains all options and arguments
behave needs (see how this method is called).
No need to duplicate them using "sys.argv[1:]"

+tests added
This commit is contained in:
Ilya.Kazakevich
2018-04-11 02:29:05 +03:00
parent 1611a60768
commit 1da58424f2
2 changed files with 4 additions and 5 deletions
+1 -2
View File
@@ -27,8 +27,7 @@ def run_as_django_behave(formatter_name, feature_names, scenario_n_options):
if apps.is_installed("behave_django"):
base = sys.argv[0]
rest = sys.argv[1:]
sys.argv = [base] + rest + ["behave", "-f{0}".format(formatter_name)] + feature_names + scenario_n_options
sys.argv = [base] + ["behave", "-f{0}".format(formatter_name)] + feature_names + scenario_n_options
print("manage.py " + " ".join(sys.argv[1:]))
ManagementUtility().execute()
return True
+3 -3
View File
@@ -86,8 +86,8 @@ envs {
createPython("py35_django20_full",
"3.5.4",
["ipython==2.1", "django==2.0", "behave", "jinja2", "tox>=2.0", "nose", "pytest", "django-nose"],
"python3.4\npython3\nipython\nipython200\nskeletons\ndjango\nbehave\ntox\njinja2\npython34\npackaging\npytest\nnose\ndjango-nose",
["ipython==2.1", "django==2.0", "behave", "jinja2", "tox>=2.0", "nose", "pytest", "django-nose", "behave-django"],
"python3.4\npython3\nipython\nipython200\nskeletons\ndjango\nbehave\ntox\njinja2\npython34\npackaging\npytest\nnose\ndjango-nose\nbehave-django\ndjango20",
true)
// Mostly for tox
@@ -107,7 +107,7 @@ envs {
createPython("pyqt_env", "3.5.4", ["pyqt5==5.10.1"], "pyqt5", true)
}
createPython("django_latest", "3.5.3", ["django"], "python3.5\ndjango", true)
createPython("django_latest", "3.5.3", ["django", "behave-django", "behave"], "python3.5\ndjango\ndjango20\nbehave\nbehave-django\ndjango20", true)
if (Os.isFamily(Os.FAMILY_WINDOWS)) { // Only windows needs ironPython