-
Notifications
You must be signed in to change notification settings - Fork 82
/
conftest.py
40 lines (28 loc) · 1.04 KB
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
from __future__ import print_function
import pytest
from oioioi.base.tests import pytest_plugin as base_plugin
from oioioi.contests.tests import pytest_plugin as contests_plugin
def pytest_addoption(parser):
parser.addoption(
'--runslow', action='store_true', default=False, help="run slow tests"
)
# called for running each test
def pytest_runtest_setup(item):
contests_plugin.pytest_runtest_setup(item)
base_plugin.pytest_runtest_setup(item)
def pytest_collection_modifyitems(config, items):
# --runslow flag: do not skip slow tests
if config.getoption('--runslow', False):
return
skip_slow = pytest.mark.skip(reason="need --runslow option to run")
for item in items:
if "slow" in item.keywords:
item.add_marker(skip_slow)
# Removing links column from html report
@pytest.mark.optionalhook
def pytest_html_results_table_header(cells):
cells.pop()
# Removing links column from html report
@pytest.mark.optionalhook
def pytest_html_results_table_row(report, cells):
cells.pop()