-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathconftest.py
More file actions
36 lines (27 loc) · 790 Bytes
/
conftest.py
File metadata and controls
36 lines (27 loc) · 790 Bytes
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
import pytest
pytest_plugins = ["pytester"]
@pytest.fixture
def sample_test_file(testdir):
testdir.makepyfile(
"""
import pytest
import logging
LOGGER = logging.getLogger(__name__)
def test_ok():
LOGGER.info("Running test_ok")
LOGGER.debug("Debug logging info")
assert True
def test_not_ok():
LOGGER.error("Running test_not_ok")
assert False
@pytest.mark.parametrize('param', ("foo", "bar"))
def test_params(param):
assert True
@pytest.mark.skip(reason='some reason')
def test_skipped():
assert False
@pytest.mark.xfail(reason='a reason')
def test_broken():
assert False
"""
)