dvarrazzo/psycopg — pull request #18 by jerickso (2014-05-19 04:11:26+00:00)
Title: Windows Testing Changes

Two tests I was having problems with on Windows which these patches solve.

select.select in test_async would hang Windows indefinitely. Adding a 10 second timeout allows Windows to continue.

test_cleanup_on_badconn_close reacts different based upon the OS of the server that psycopg connects against. FreeBSD passes the test, but a Windows version of the PostgreSQL server does not. I believe this is because PostgreSQL tries to emulate the UNIX SIGUP functionality on Windows, but it doesn't act the same causing the discrepancies. I'm not totally satisfied with the solution (skip the test if running the test on Windows), as a better solution would be to skip the test if the PostgreSQL server was running on Windows, but didn't know of a way to do that besides run 'select version();', and then parse the result (Which I could see being messy as Windows didn't list the OS like some other varients, but did list the compiler, (ie. "PostgreSQL 9.3.4, compiled by Visual C++ build 1600, 32-bit" vs "PostgreSQL 9.3.4 on amd64-portbld-freebsd10.0, compiled by FreeBSD clang version 3.4 (tags/RELEASE_34/final 197956) 20140216, 64-bit")).