-
-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathconftest.py
More file actions
41 lines (31 loc) · 843 Bytes
/
conftest.py
File metadata and controls
41 lines (31 loc) · 843 Bytes
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import os
import pytest
@pytest.fixture
def example():
def _example(name):
with open(
os.path.join(os.path.dirname(__file__), "examples", name + ".toml"),
encoding="utf-8",
) as f:
return f.read()
return _example
@pytest.fixture
def json_example():
def _example(name):
with open(
os.path.join(os.path.dirname(__file__), "examples", "json", name + ".json"),
encoding="utf-8",
) as f:
return f.read()
return _example
@pytest.fixture
def invalid_example():
def _example(name):
with open(
os.path.join(
os.path.dirname(__file__), "examples", "invalid", name + ".toml"
),
encoding="utf-8",
) as f:
return f.read()
return _example