test: convert some more tests to use fixtures
authorPeter Wu <peter@lekensteyn.nl>
Tue, 13 Nov 2018 01:17:33 +0000 (02:17 +0100)
committerAnders Broman <a.broman58@gmail.com>
Wed, 14 Nov 2018 05:00:37 +0000 (05:00 +0000)
commit4f61d77293c29c7363cca00b56a282eeeec575f1
tree7fdcced832d170de4160cab7431fa5fae70782be
parent50433f4b4dde42ce50b0e2d899671c2b2cef526d
test: convert some more tests to use fixtures

Continue the conversion from use of globals (the config module) to
fixtures. If a program (like wmem_test or tshark) is unavailable, it
will be skipped now rather than failing the test.

The general conversion pattern is:
- Decorate each class with `@fixtures.uses_fixtures` and (for tests that
  run tshark) `@fixtures.mark_usefixtures('test_env')`.
- Convert all `config.cmd_*` to `cmd_*` and add an argument.
- Convert all `config.*_dir` to `dirs.*_dir` and add an argument.
- Convert users of `os.path.join(dirs.capture_file, ...)` to use a new
  'capture_file' fixture to reduce boilerplate code. Inline variables if
  possible (this conversion was done in an automated way using regexes).

Some other changes: tests that do not require a test environment (like
wmem_test) will use 'base_env' which avoids copying config files,
`env=config.test_env` got removed since this is the default. Some test
classes in suite_clopts were combined. Removed unused imports.

Change-Id: Id5480ffaee7d8d56cf2cb3189a38ae9afa7605a1
Reviewed-on: https://code.wireshark.org/review/30591
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
test/fixtures_ws.py
test/suite_clopts.py
test/suite_decryption.py
test/suite_dissection.py
test/suite_fileformats.py
test/suite_follow.py
test/suite_io.py
test/suite_mergecap.py
test/suite_sharkd.py
test/suite_unittests.py
test/suite_wslua.py