Wireless Daemon for Linux
 help / color / mirror / Atom feed
* [PATCH] test-runner: use **kwargs for start_process
@ 2020-09-15 17:36 James Prestwood
  2020-09-15 21:46 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: James Prestwood @ 2020-09-15 17:36 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 1009 bytes --]

This is just a more concise/pythonic way of doing function arguments.
Since Process/start_process have basically the same argument names
we can simplify and use **kwargs which will pass the named arguments
directly to Process(). This also allows us to add arguments to Process
without touching start_process if we need.
---
 tools/test-runner | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tools/test-runner b/tools/test-runner
index a71b9ef6..d1e1d42c 100755
--- a/tools/test-runner
+++ b/tools/test-runner
@@ -465,10 +465,10 @@ class TestContext:
 		self.results = {}
 		self.mainloop = GLib.MainLoop()
 
-	def start_process(self, args, wait=False, multi_test=False, env=None, check=False):
-		p = Process(args, wait, multi_test, env, ctx=self, check=check)
+	def start_process(self, args, **kwargs):
+		p = Process(args, ctx=self, **kwargs)
 
-		if not wait:
+		if not kwargs.get('wait', False):
 			self.processes.append(p)
 
 		return p
-- 
2.26.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] test-runner: use **kwargs for start_process
  2020-09-15 17:36 [PATCH] test-runner: use **kwargs for start_process James Prestwood
@ 2020-09-15 21:46 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2020-09-15 21:46 UTC (permalink / raw)
  To: iwd

[-- Attachment #1: Type: text/plain, Size: 533 bytes --]

Hi James,

On 9/15/20 12:36 PM, James Prestwood wrote:
> This is just a more concise/pythonic way of doing function arguments.
> Since Process/start_process have basically the same argument names
> we can simplify and use **kwargs which will pass the named arguments
> directly to Process(). This also allows us to add arguments to Process
> without touching start_process if we need.
> ---
>   tools/test-runner | 6 +++---
>   1 file changed, 3 insertions(+), 3 deletions(-)
> 


Applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-09-15 21:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-15 17:36 [PATCH] test-runner: use **kwargs for start_process James Prestwood
2020-09-15 21:46 ` Denis Kenzior

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox