Skip to content

Commit e3b3120

Browse files
authored
Merge pull request #17 from adelosa/fix-windows-support
Fix to support Windows
2 parents c79c854 + 13f757a commit e3b3120

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/testing/postgresql.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def is_server_available(self):
114114

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

119119

120120
class PostgresqlFactory(DatabaseFactory):

tests/test_postgresql.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ def test_postgresql_is_not_found(self):
111111
testing.postgresql.SEARCH_PATHS = search_paths
112112
os.environ['PATH'] = path_env
113113

114+
@unittest.skipIf(os.name == 'nt', 'Windows does not have fork()')
114115
def test_fork(self):
115116
pgsql = testing.postgresql.Postgresql()
116117
if os.fork() == 0:
@@ -122,6 +123,7 @@ def test_fork(self):
122123
sleep(1)
123124
self.assertTrue(pgsql.is_alive()) # process is alive (delete pgsql obj in child does not effect)
124125

126+
@unittest.skipIf(os.name == 'nt', 'Windows does not have fork()')
125127
def test_stop_on_child_process(self):
126128
pgsql = testing.postgresql.Postgresql()
127129
if os.fork() == 0:

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[tox]
22
envlist=py27,py34,py35,py36
33

4-
[testenv]
4+
[base]
55
deps=
66
nose
77
flake8

0 commit comments

Comments
 (0)