mirror of
https://github.com/planetmint/planetmint.git
synced 2025-11-25 23:15:44 +00:00
_setup_database fixture restored.(STILL NOT WORKING in this commit)
This commit is contained in:
parent
a864f8b7e1
commit
8e88c12722
@ -123,20 +123,37 @@ def _configure_planetmint(request):
|
|||||||
|
|
||||||
@pytest.fixture(scope='session')
|
@pytest.fixture(scope='session')
|
||||||
def _setup_database(_configure_planetmint): # TODO Here is located setup database
|
def _setup_database(_configure_planetmint): # TODO Here is located setup database
|
||||||
from planetmint.backend.tarantool.connection import TarantoolDB
|
from planetmint.backend.connection import Connection
|
||||||
|
from planetmint.config import Config
|
||||||
|
|
||||||
print('Deleting `{}` database')
|
# print('Deleting `{}` database')
|
||||||
db_conn = Connection()
|
# db_conn = Connection()
|
||||||
db_conn.drop_database()
|
# db_conn.drop_database()
|
||||||
db_conn.init_database()
|
# db_conn.init_database()
|
||||||
print('Finished deleting ``')
|
# print('Finished deleting ``')
|
||||||
|
#
|
||||||
|
# yield
|
||||||
|
#
|
||||||
|
# print('Initializing test db')
|
||||||
|
# db_conn2 = Connection()
|
||||||
|
# db_conn2.drop_database()
|
||||||
|
# print('Finishing init database')
|
||||||
|
|
||||||
|
print('Initializing test db')
|
||||||
|
dbname = Config().get()['database']['name']
|
||||||
|
conn = Connection()
|
||||||
|
|
||||||
|
_drop_db(conn, dbname)
|
||||||
|
schema.init_database(conn)
|
||||||
|
print('Finishing init database')
|
||||||
|
|
||||||
yield
|
yield
|
||||||
|
|
||||||
print('Initializing test db')
|
print('Deleting `{}` database'.format(dbname))
|
||||||
db_conn2 = Connection()
|
conn = Connection()
|
||||||
db_conn2.drop_database()
|
_drop_db(conn, dbname)
|
||||||
print('Finishing init database')
|
|
||||||
|
print('Finished deleting `{}`'.format(dbname))
|
||||||
|
|
||||||
|
|
||||||
@pytest.fixture
|
@pytest.fixture
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user