last commit

This commit is contained in:
andrei 2022-04-12 15:25:49 +03:00
parent b587640fc5
commit efee20c6ab
4 changed files with 51 additions and 51 deletions

View File

@ -24,6 +24,7 @@ version = {}
with open('planetmint/version.py') as fp:
exec(fp.read(), version)
def check_setuptools_features():
"""Check if setuptools is up to date."""
import pkg_resources

View File

@ -3,24 +3,24 @@ from planetmint.backend.connection import Connection
#
#
#
@pytest.fixture
def dummy_db(request):
from planetmint.backend import Connection
conn = Connection()
dbname = request.fixturename
xdist_suffix = getattr(request.config, 'slaveinput', {}).get('slaveid')
if xdist_suffix:
dbname = '{}_{}'.format(dbname, xdist_suffix)
conn.drop_database()
#_drop_db(conn, dbname) # make sure we start with a clean DB
#schema.init_database(conn, dbname)
conn.init_database()
yield dbname
conn.drop_database()
#_drop_db(conn, dbname)
# @pytest.fixture
# def dummy_db(request):
# from planetmint.backend import Connection
#
# conn = Connection()
# dbname = request.fixturename
# xdist_suffix = getattr(request.config, 'slaveinput', {}).get('slaveid')
# if xdist_suffix:
# dbname = '{}_{}'.format(dbname, xdist_suffix)
#
# conn.drop_database()
# #_drop_db(conn, dbname) # make sure we start with a clean DB
# #schema.init_database(conn, dbname)
# conn.init_database()
# yield dbname
#
# conn.drop_database()
# #_drop_db(conn, dbname)
#def _drop_db(conn, dbname):
# try:

View File

@ -28,10 +28,9 @@ def _check_spaces_by_list(conn, space_names):
def test_create_tables():
conn = TarantoolDB('localhost', 3303)
# The db is set up by the fixtures so we need to remove it
conn.drop_database()
# conn.drop_database()
conn.init_database()
# TODO verify spaces
assert conn.SPACE_NAMES == _check_spaces_by_list(conn=conn, space_names=conn.SPACE_NAMES)

View File

@ -316,22 +316,22 @@ def inputs(user_pk, b, alice):
b.store_bulk_transactions(transactions)
@pytest.fixture
def dummy_db(request):
from planetmint.backend import Connection
conn = Connection()
dbname = request.fixturename
xdist_suffix = getattr(request.config, 'slaveinput', {}).get('slaveid')
if xdist_suffix:
dbname = '{}_{}'.format(dbname, xdist_suffix)
_drop_db(conn, dbname) # make sure we start with a clean DB
schema.init_database(conn, dbname)
yield dbname
_drop_db(conn, dbname)
# @pytest.fixture
# def dummy_db(request):
# from planetmint.backend import Connection
#
# conn = Connection()
# dbname = request.fixturename
# xdist_suffix = getattr(request.config, 'slaveinput', {}).get('slaveid')
# if xdist_suffix:
# dbname = '{}_{}'.format(dbname, xdist_suffix)
#
#
# _drop_db(conn, dbname) # make sure we start with a clean DB
# schema.init_database(conn, dbname)
# yield dbname
#
# _drop_db(conn, dbname)
def _drop_db(conn, dbname):