forked from HPAC/matchpy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconftest.py
21 lines (18 loc) · 860 Bytes
/
conftest.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-
import pytest
from matchpy.expressions.expressions import Operation, Symbol, Arity, Wildcard, make_dot_variable, make_star_variable, make_plus_variable
import matchpy
@pytest.fixture(autouse=True)
def add_default_expressions(doctest_namespace):
doctest_namespace['f'] = Operation.new('f', Arity.variadic)
doctest_namespace['a'] = Symbol('a')
doctest_namespace['b'] = Symbol('b')
doctest_namespace['c'] = Symbol('c')
doctest_namespace['x_'] = make_dot_variable('x')
doctest_namespace['y_'] = make_dot_variable('y')
doctest_namespace['_'] = Wildcard.dot()
doctest_namespace['__'] = Wildcard.plus()
doctest_namespace['___'] = Wildcard.star()
doctest_namespace['__name__'] = '__main__'
for name in matchpy.__all__:
doctest_namespace[name] = getattr(matchpy, name)