aboutsummaryrefslogtreecommitdiffstats
path: root/test/subprocesstest.py
diff options
context:
space:
mode:
authorPeter Wu <peter@lekensteyn.nl>2018-11-16 02:28:32 +0100
committerPeter Wu <peter@lekensteyn.nl>2018-11-16 13:55:40 +0000
commit88ce087dcfc3aaae3d290276333091d324a6fcb9 (patch)
tree41b474b1c641029ba36d4099a8877625e64da64a /test/subprocesstest.py
parent3ab521118a0d068e0d5c795a5a57b13cd7790a75 (diff)
test: finalize suite_capture conversion to fixtures, drop config.py
Convert the old start_pinging routine to use pytest fixtures, rewriting it to enable a different generator that uses (for example) UDP. Remove the config module since it is no longer neded. Change-Id: Ic4727157faab084b41144e8f16ea44f59c9037d8 Reviewed-on: https://code.wireshark.org/review/30659 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Diffstat (limited to 'test/subprocesstest.py')
-rw-r--r--test/subprocesstest.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/test/subprocesstest.py b/test/subprocesstest.py
index 060ebeb3a4..9f6b2f001f 100644
--- a/test/subprocesstest.py
+++ b/test/subprocesstest.py
@@ -23,8 +23,6 @@ import unittest
# - Add a subprocesstest.SkipUnlessCapture decorator?
# - Try to catch crashes? See the comments below in waitProcess.
-# XXX This should probably be in config.py and settable from
-# the command line.
process_timeout = 300 # Seconds
def cat_dhcp_command(mode):
@@ -33,7 +31,8 @@ def cat_dhcp_command(mode):
sd_cmd = ''
if sys.executable:
sd_cmd = '"{}" '.format(sys.executable)
- sd_cmd += os.path.join(config.this_dir, 'util_dump_dhcp_pcap.py ' + mode)
+ this_dir = os.path.dirname(__file__)
+ sd_cmd += os.path.join(this_dir, 'util_dump_dhcp_pcap.py ' + mode)
return sd_cmd
class LoggingPopen(subprocess.Popen):
@@ -256,9 +255,6 @@ class SubprocessTestCase(unittest.TestCase):
# fixture (via a test method parameter or class decorator).
assert not (env is None and hasattr(self, '_fixture_request')), \
"Decorate class with @fixtures.mark_usefixtures('test_env')"
- if env is None:
- # Avoid using the test user's real environment by default.
- env = config.test_env
proc = LoggingPopen(proc_args, stdin=stdin, env=env, shell=shell, log_fd=self.log_fd)
self.processes.append(proc)
return proc