Skip to content

Commit b1c1af1

Browse files
add tests for integration plugin
1 parent 8e60e03 commit b1c1af1

File tree

2 files changed

+23
-2
lines changed

2 files changed

+23
-2
lines changed

tests/integration/test_plugin.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
import pytest
44

5+
from tests.plugins.integration import CLI_FLAG
56

6-
def test_automatically_skip():
7-
pytest.fail("tests in `integration` directory should be automatically skipped")
7+
8+
def test_automatically_skip(request):
9+
if not request.config.getoption(CLI_FLAG):
10+
pytest.fail("tests in `integration` directory should be automatically skipped")

tests/plugins/test_integration.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
from __future__ import annotations
2+
3+
from .integration import CLI_FLAG
4+
from .integration import MARK
5+
6+
7+
def test_cli_flag_registered(pytestconfig):
8+
assert pytestconfig.getoption(CLI_FLAG) in (
9+
True,
10+
False,
11+
), f"{CLI_FLAG} should be registered with pytest"
12+
13+
14+
def test_markers_registered(pytestconfig):
15+
markers = pytestconfig.getini("markers")
16+
assert any(
17+
f"{MARK}:" in marker for marker in markers
18+
), f"{MARK} marker should be registered"

0 commit comments

Comments
 (0)