Skip to content

Commit

Permalink
Merge 4d3ef9c into 738c8eb
Browse files Browse the repository at this point in the history
  • Loading branch information
adelosa committed Oct 24, 2016
2 parents 738c8eb + 4d3ef9c commit 91739bd
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/testing/postgresql.py
Expand Up @@ -113,7 +113,7 @@ def is_server_available(self):

def terminate(self, *args):
# send SIGINT instead of SIGTERM
super(Postgresql, self).terminate(signal.SIGINT)
super(Postgresql, self).terminate(signal.SIGINT if os.name != 'nt' else None)


class PostgresqlFactory(DatabaseFactory):
Expand Down
2 changes: 2 additions & 0 deletions tests/test_postgresql.py
Expand Up @@ -116,6 +116,7 @@ def test_postgresql_is_not_found(self):
testing.postgresql.SEARCH_PATHS = search_paths
os.environ['PATH'] = path_env

@unittest.skipIf(os.name == 'nt', 'Windows does not have fork()')
def test_fork(self):
pgsql = testing.postgresql.Postgresql()
if os.fork() == 0:
Expand All @@ -127,6 +128,7 @@ def test_fork(self):
sleep(1)
self.assertTrue(pgsql.is_alive()) # process is alive (delete pgsql obj in child does not effect)

@unittest.skipIf(os.name == 'nt', 'Windows does not have fork()')
def test_stop_on_child_process(self):
pgsql = testing.postgresql.Postgresql()
if os.fork() == 0:
Expand Down
11 changes: 8 additions & 3 deletions tox.ini
@@ -1,12 +1,16 @@
[tox]
envlist=py26,py27,py32,py33,py34,py35

[testenv]
[base]
deps=
nose
flake8
psycopg2
SQLAlchemy

[testenv]
deps=
{[base]deps}
flake8
passenv=
TRAVIS*
commands=
Expand All @@ -15,8 +19,9 @@ commands=

[testenv:py26]
deps=
{[testenv]deps}
{[base]deps}
unittest2
flake8==2.6.0

[testenv:coverage]
deps=
Expand Down

0 comments on commit 91739bd

Please sign in to comment.