Skip to content
Snippets Groups Projects
Commit 26e13d59 authored by Philippe Pepiot's avatar Philippe Pepiot
Browse files

Drop param check_returncode in _single_execute()

It's never used without default value (True).
parent 932583d1
No related branches found
No related tags found
No related merge requests found
......@@ -208,5 +208,5 @@
times.append(func(*args, **kwargs))
return median(times)
def _execute(self, command, check_returncode=True, *args):
def _execute(self, command, *args):
cmd = self._prepare_cmd(command, *args)
......@@ -212,5 +212,5 @@
cmd = self._prepare_cmd(command, *args)
return self._timeit(self._single_execute, (cmd, check_returncode))
return self._timeit(self._single_execute, (cmd,))
def _prepare_cmd(self, command, *args):
cmd = [
......@@ -221,5 +221,5 @@
return cmd
def _single_execute(self, cmd, check_returncode=True):
def _single_execute(self, cmd):
before = time.time()
......@@ -225,17 +225,7 @@
before = time.time()
if check_returncode is True:
try:
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT,
env=self.environ)
after = time.time()
duration = after - before
return duration
except subprocess.CalledProcessError as e:
raise
else:
subprocess.call(cmd, stderr=subprocess.STDOUT,
env=self.environ)
try:
output = subprocess.check_output(cmd, stderr=subprocess.STDOUT,
env=self.environ)
after = time.time()
duration = after - before
return duration
......@@ -239,8 +229,8 @@
after = time.time()
duration = after - before
return duration
except subprocess.CalledProcessError as e:
raise
class BaseTimeTestSuite(BaseTestSuite):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment