test: split SubprocessTestCase.run into setUp/tearDown
authorPeter Wu <peter@lekensteyn.nl>
Thu, 3 Jan 2019 18:07:40 +0000 (19:07 +0100)
committerAnders Broman <a.broman58@gmail.com>
Fri, 4 Jan 2019 04:58:25 +0000 (04:58 +0000)
commit6c5da2804b00ae28b4837f56fa38671753ac64f8
treef57b4db77c3bda5f6e53aabdfa196d6e9419cb5c
parentda4aea6b55fe7cb7e718adf74aaca38f11ed88e0
test: split SubprocessTestCase.run into setUp/tearDown

The run method is not invoked when running in debug mode (for example,
with `pytest --pdb`) and would result in spurious errors due to "log_fd"
being None. Split the method to resolve this incompatibility.

Note that with `pytest --pdb`, the tearDown method is not called when
exceptions occur, see https://docs.pytest.org/en/latest/unittest.html

Change-Id: I4b66c03d5b050b53311ec64021fe17dc91bb48dd
Reviewed-on: https://code.wireshark.org/review/31339
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
test/subprocesstest.py