test: lua: add a test for invalid ethernet address
[metze/wireshark/wip.git] / test / conftest.py
1 #
2 # -*- coding: utf-8 -*-
3 # Wireshark tests
4 #
5 # Copyright (c) 2018 Peter Wu <peter@lekensteyn.nl>
6 #
7 # SPDX-License-Identifier: GPL-2.0-or-later
8 #
9 '''py.test configuration'''
10
11 import fixtures
12
13 def pytest_addoption(parser):
14     parser.addoption('--disable-capture', action='store_true',
15         help='Disable capture tests'
16     )
17     parser.addoption('--capture-interface',
18         help='Capture interface index or name.'
19     )
20     parser.addoption('--program-path', help='Path to Wireshark executables.')
21
22 _all_test_groups = None
23
24 # this is set only to please case_unittests.test_unit_ctest_coverage
25 def pytest_collection_modifyitems(items):
26     '''Find all test groups.'''
27     global _all_test_groups
28     suites = []
29     for item in items:
30         name = item.nodeid.split("::")[0].replace(".py", "").replace("/", ".")
31         if name not in suites:
32             suites.append(name)
33     _all_test_groups = sorted(suites)
34
35 # Must enable pytest before importing fixtures_ws.
36 fixtures.enable_pytest()
37 from fixtures_ws import *
38
39 @fixtures.fixture(scope='session')
40 def all_test_groups():
41     return _all_test_groups