-
Notifications
You must be signed in to change notification settings - Fork 76
/
conftest.py
52 lines (43 loc) · 1.23 KB
/
conftest.py
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
42
43
44
45
46
47
48
49
50
51
52
import pytest
@pytest.fixture()
def msg_assertions():
from tests.utils import (
assert_error_message_equal,
assert_message_in_errors,
assert_message_not_in_errors,
assert_path_in_errors,
assert_path_not_in_errors,
)
_dict = {
'assert_error_message_equal': staticmethod(assert_error_message_equal),
'assert_message_in_errors': staticmethod(assert_message_in_errors),
'assert_message_not_in_errors': staticmethod(assert_message_not_in_errors),
'assert_path_in_errors': staticmethod(assert_path_in_errors),
'assert_path_not_in_errors': staticmethod(assert_path_not_in_errors),
}
return type('AssertionHelpers', (object,), _dict)
@pytest.fixture()
def types():
from flex.constants import (
NULL,
BOOLEAN,
STRING,
INTEGER,
NUMBER,
ARRAY,
OBJECT,
)
_dict = {
'NULL': NULL,
'BOOLEAN': BOOLEAN,
'STRING': STRING,
'INTEGER': INTEGER,
'NUMBER': NUMBER,
'ARRAY': ARRAY,
'OBJECT': OBJECT,
}
return type('Types', (object,), _dict)
@pytest.fixture()
def MESSAGES():
from flex.error_messages import MESSAGES
return MESSAGES