[skeleton/pytestconf] provide an acceptable solution for windows, closes #1875488
--- a/skeleton/test/pytestconf.py Wed Jul 20 18:21:47 2011 +0200
+++ b/skeleton/test/pytestconf.py Tue Jul 26 16:05:36 2011 +0200
@@ -19,7 +19,7 @@
"""
import os
-import pwd
+import sys
from logilab.common.pytest import PyTester
@@ -28,6 +28,9 @@
(man 3 getlogin)
Another solution would be to use $LOGNAME, $USER or $USERNAME
"""
+ if sys.platform == 'win32':
+ return os.environ.get('USERNAME') or 'cubicweb'
+ import pwd
return pwd.getpwuid(os.getuid())[0]