File: conftest.py

package info (click to toggle)
python-consolekit 1.7.2-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,152 kB
  • sloc: python: 2,835; makefile: 8
file content (16 lines) | stat: -rw-r--r-- 483 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
# stdlib
from typing import Optional

pytest_plugins = ("coincidence", "consolekit.testing")

try:
	# 3rd party
	from pytest_mypy_plugins.collect import YamlTestFile, pytest_addoption  # noqa: F401

	def pytest_collect_file(file_path, parent) -> Optional[YamlTestFile]:  # noqa: MAN001
		if file_path.suffix == ".yaml" and file_path.name.startswith(("test-", "test_")):
			return YamlTestFile.from_parent(parent, path=file_path, fspath=None)
		return None

except ImportError:
	pass