Пример #1
0
from __future__ import unicode_literals

import pytest

from clldutils import path

import pyglottolog

TESTS_DIR = path.Path(__file__).parent


@pytest.fixture
def elcat(mocker):
    class EL(object):
        def get(self, *args, **kw):
            return mocker.Mock(text='1,abc,Name,,,,,,,,,,"10,20.02 ;"')

    mocker.patch('pyglottolog.links.endangeredlanguages.requests', EL())


@pytest.fixture(scope='session')
def repos_path():
    return TESTS_DIR / 'repos'


@pytest.fixture(scope='session')
def references_path(repos_path):
    return repos_path / 'references'


@pytest.fixture(scope='session')
Пример #2
0
 def __init__(self, filepath):
     if not isinstance(filepath, path.Path):
         filepath = path.Path(filepath)
     self.filepath = filepath
     self.engine = sa.create_engine('sqlite:///%s' % filepath,
                                    paramstyle='qmark')
Пример #3
0
from __future__ import unicode_literals

import pytest

from clldutils import path

DATA = path.Path(__file__).parent / 'data'


@pytest.fixture(scope='module')
def data():
    return DATA