Debian Codegraph @

test/jpypetest/conftest.py

raw symbols SCIP
1 # *****************************************************************************
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License is distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14 #
15 # See NOTICE file for details.
16 #
17 # *****************************************************************************
18
19 import pytest
20
21 import common
22
23
24 def pytest_addoption(parser):
25 parser.addoption('--classpath', action="store", default=None,
26 help="Use a jar rather than the thunks")
27 parser.addoption('--convertStrings', action="store_true",
28 default=False, help="Give convert strings to startJVMs")
29 parser.addoption('--jacoco', action="store_true",
30 default=False, help="Add Java coverage tool")
31 parser.addoption('--checkjni', action="store_true",
32 default=False, help="Enable JNI checking")
33 parser.addoption('--fast', action="store_true",
34 default=False, help="Skip subrun tests")
35
36
37 def pytest_collection_modifyitems(config, items):
38 if config.getoption("--fast"):
39 common.fast = True
40
41
42 @pytest.fixture(scope="class")
43 def common_opts(request):
44 request.cls._classpath = request.config.getoption("--classpath")
45 request.cls._convertStrings = request.config.getoption("--convertStrings")
46 request.cls._jacoco = request.config.getoption("--jacoco")
47 request.cls._checkjni = request.config.getoption("--checkjni")