File: conftest.py

package info (click to toggle)
sphinxcontrib-openapi 0.8.4-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 876 kB
  • sloc: python: 7,575; makefile: 15
file content (26 lines) | stat: -rw-r--r-- 475 bytes parent folder | download | duplicates (2)
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
"""Some shared goodies."""

import textwrap

import pytest
import yaml

from sphinxcontrib.openapi import renderers


@pytest.fixture(scope="function")
def fakestate():
    return None


@pytest.fixture(scope="function")
def testrenderer(fakestate):
    return renderers.HttpdomainRenderer(fakestate, {})


@pytest.fixture(scope="function")
def oas_fragment():
    def oas_fragment(fragment):
        return yaml.safe_load(textwrap.dedent(fragment))

    return oas_fragment