1
0
Fork 0

Add behave to tox

This commit is contained in:
Dick Marinus 2017-05-22 20:44:02 +02:00
parent 324abde72a
commit bbb0866806
4 changed files with 28 additions and 10 deletions

View File

@ -1,3 +1,10 @@
Upcoming
========
Internal changes:
-----------------
* Add behave to tox (Thanks: `Dick Marinus`_).
1.5.1
=====

View File

@ -1,5 +0,0 @@
[behave.userdata]
pg_test_user = postgres
pg_test_pass =
pg_test_host = localhost
pg_test_db = pgcli_behave_tests

View File

@ -17,17 +17,29 @@ def before_all(context):
os.environ['PAGER'] = 'cat'
os.environ['EDITOR'] = 'nano'
context.package_root = os.path.abspath(
os.path.dirname(os.path.dirname(os.path.dirname(__file__))))
context.exit_sent = False
vi = '_'.join([str(x) for x in sys.version_info[:3]])
db_name = context.config.userdata.get('pg_test_db', None)
db_name = context.config.userdata.get('pg_test_db', 'pgcli_behave_tests')
db_name_full = '{0}_{1}'.format(db_name, vi)
# Store get params from config.
context.conf = {
'host': context.config.userdata.get('pg_test_host', 'localhost'),
'user': context.config.userdata.get('pg_test_user', 'postgres'),
'pass': context.config.userdata.get('pg_test_pass', None),
'host': context.config.userdata.get(
'pg_test_host',
os.getenv('PGHOST', 'localhost')
),
'user': context.config.userdata.get(
'pg_test_user',
os.getenv('PGUSER', 'postgres')
),
'pass': context.config.userdata.get(
'pg_test_pass',
os.getenv('PGPASSWORD', None)
),
'dbname': db_name_full,
'dbname_tmp': db_name_full + '_tmp',
'vi': vi

View File

@ -1,8 +1,12 @@
[tox]
envlist = py26, py27, py33, py34, py35, py36
envlist = py27, py33, py34, py35, py36
[testenv]
deps = pytest
mock
pgspecial
humanize
commands = py.test
behave tests/features
passenv = PGHOST
PGUSER
PGPASSWORD