File: conftest.py

package info (click to toggle)
jsonpath-ng 1.7.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 372 kB
  • sloc: python: 2,172; makefile: 4
file content (15 lines) | stat: -rw-r--r-- 403 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import pytest


@pytest.fixture(autouse=True)
def disable_auto_id_field(monkeypatch):
    monkeypatch.setattr("jsonpath_ng.jsonpath.auto_id_field", None)


@pytest.fixture()
def auto_id_field(monkeypatch, disable_auto_id_field):
    """Enable `jsonpath_ng.jsonpath.auto_id_field`."""

    field_name = "id"
    monkeypatch.setattr("jsonpath_ng.jsonpath.auto_id_field", field_name)
    return field_name