Skip to content
This repository
Browse code

In pyrseas/testutils.py, use getpass.getuser instead of os.getenv("US…

…ER").

  This makes the tests portable to Windows.
  • Loading branch information...
commit 7a74b94527dc842a60ff4cede3b55c5ed52f4a97 1 parent 0052e8a
Joe Abbate authored October 03, 2012

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  pyrseas/testutils.py
3  pyrseas/testutils.py
@@ -2,6 +2,7 @@
2 2
 """Utility functions and classes for testing Pyrseas"""
3 3
 
4 4
 import os
  5
+import getpass
5 6
 from unittest import TestCase
6 7
 
7 8
 from psycopg2 import connect
@@ -53,7 +54,7 @@ def pgexecute_auto(dbconn, query):
53 54
 
54 55
 
55 56
 TEST_DBNAME = os.environ.get("PYRSEAS_TEST_DB", 'pyrseas_testdb')
56  
-TEST_USER = os.environ.get("PYRSEAS_TEST_USER", os.getenv("USER"))
  57
+TEST_USER = os.environ.get("PYRSEAS_TEST_USER", getpass.getuser())
57 58
 TEST_HOST = os.environ.get("PYRSEAS_TEST_HOST", None)
58 59
 TEST_PORT = os.environ.get("PYRSEAS_TEST_PORT", None)
59 60
 ADMIN_DB = os.environ.get("PYRSEAS_ADMIN_DB", 'postgres')

0 notes on commit 7a74b94

Please sign in to comment.
Something went wrong with that request. Please try again.