Wireshark-commits: [Wireshark-commits] master 4f61d77: test: convert some more tests to use fixture
URL: https://code.wireshark.org/review/gitweb?p=wireshark.git;a=commit;h=4f61d77293c29c7363cca00b56a282eeeec575f1
Submitter: "Anders Broman <a.broman58@xxxxxxxxx>"
Changed: branch: master
Repository: wireshark
Commits:
4f61d77 by Peter Wu (peter@xxxxxxxxxxxxx):
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@xxxxxxxxxxxxx>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@xxxxxxxxx>
Actions performed:
from 50433f4 Dumpcap: Move packet dequeueing code to a common routine.
add 4f61d77 test: convert some more tests to use fixtures
Summary of changes:
test/fixtures_ws.py | 8 +
test/suite_clopts.py | 178 +++++++-------
test/suite_decryption.py | 589 +++++++++++++++++++++-------------------------
test/suite_dissection.py | 15 +-
test/suite_fileformats.py | 86 ++++---
test/suite_follow.py | 15 +-
test/suite_io.py | 48 ++--
test/suite_mergecap.py | 131 +++++------
test/suite_sharkd.py | 23 +-
test/suite_unittests.py | 47 ++--
test/suite_wslua.py | 175 +++++++-------
11 files changed, 641 insertions(+), 674 deletions(-)