Skip to content

Commit

Permalink
Add behave to tox
Browse files Browse the repository at this point in the history
  • Loading branch information
meeuw committed May 22, 2017
1 parent 324abde commit bbb0866
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 10 deletions.
7 changes: 7 additions & 0 deletions changelog.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Upcoming
========

Internal changes:
-----------------
* Add behave to tox (Thanks: `Dick Marinus`_).

1.5.1
=====

Expand Down
5 changes: 0 additions & 5 deletions tests/behave.ini

This file was deleted.

20 changes: 16 additions & 4 deletions tests/features/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bbb0866

Please sign in to comment.