File: test_find_plugin.py

package info (click to toggle)
pybtex-docutils 1.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 252 kB
  • sloc: python: 460; makefile: 144
file content (20 lines) | stat: -rw-r--r-- 546 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# note: tests require pybtex-docutils to be installed
# so its entry points can be found

from importlib.metadata import entry_points

import pytest
import pybtex_docutils


@pytest.mark.plugin
def test_importlib_metadata_entry_point():
    for ep in entry_points(group="pybtex.backends", name="docutils"):
        assert ep.load() is pybtex_docutils.Backend


@pytest.mark.plugin
def test_pybtex_find_plugin():
    from pybtex.plugin import find_plugin
    assert (
        find_plugin("pybtex.backends", "docutils") is pybtex_docutils.Backend)