Skip to content

Commit

Permalink
Fix runner-options argument on Django test runner (#221)
Browse files Browse the repository at this point in the history
  • Loading branch information
yakky authored Jul 9, 2023
1 parent 1bba8eb commit 195e4a6
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions app_helper/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ def _test_run_worker(test_labels, test_runner, failfast=False, runner_options=No
if "PytestTestRunner" in test_runner:
kwargs["pytest_args"] = runner_options
else:
if not isinstance(runner_options, list):
runner_options = runner_options.split(" ")
extra = _parse_runner_options(TestRunner, runner_options)
extra.update(kwargs)
kwargs = extra
Expand Down
1 change: 1 addition & 0 deletions app_helper/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def _init_runserver(runserver_module, bind, port, verbose, logger=None, channels
"use_static_handler": True,
"use_threading": True,
"verbosity": verbose,
"skip_checks": True,
"use_reloader": True,
},
)
Expand Down
1 change: 1 addition & 0 deletions changes/220.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix runner-options argument on Django test runner
2 changes: 1 addition & 1 deletion tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -604,7 +604,7 @@ def test_testrun_runner_options(self):
args["--persistent"] = True
args["--runner"] = "runners.CapturedOutputRunner"
args["<test-label>"] = self.application
args["--runner-options"] = ["--tag=a-tag"]
args["--runner-options"] = "--tag=a-tag"
core(args, self.application)
self.assertTrue("Ran 1 test in" in err.getvalue())
self.assertEqual(exit_state.exception.code, 0)
Expand Down

0 comments on commit 195e4a6

Please sign in to comment.