[silva-dev] Running Silva unittests on Windows

Luthiger Stoll Benno benno.luthiger at id.ethz.ch
Mon Nov 27 10:58:08 CET 2006


Hello Sam

I'm doing unittests (on Windows) here and then.
For that my test modules run using the Silva testing framework, I had to add the following commands at the beginning of the modules:
===
import os, sys
pjoin = os.path.join
if __name__ == '__main__':
    _fs_meta_path = pjoin(sys.path[0], '..', 'meta')
    execfile(pjoin(sys.path[0], '..', '..', 'Silva', 'tests', 'framework.py'))
else:
    _fs_meta_path = pjoin('..', 'meta')
===

HTH
Benno


-----Original Message-----
From: silva-dev-bounces at infrae.com
[mailto:silva-dev-bounces at infrae.com]On Behalf Of Samuel Schluep
Sent: Freitag, 24. November 2006 14:07
To: Silva Developer
Subject: [silva-dev] Running Silva unittests on Windows


Hi altogether

Does anybody know how to run the Silva unittests on Windows XP? Is this 
possible at all? I did the following so far:

1. There was no 'zopectl.bat' batch file in the {zope-instance}\bin 
directory. Therefore I created one:

@set PYTHON=C:\prog\Python23\python.exe
@set ZOPE_HOME=E:\prog\Zope-2.8.5-final
@set INSTANCE_HOME=E:\prog\dlcms1.6
@set SOFTWARE_HOME=E:\prog\Zope-2.8.5-final\lib\python
@set CONFIG_FILE=E:\prog\dlcms1.6\etc\zope.conf
@set PYTHONPATH=%SOFTWARE_HOME%
@set ZDCTL=%SOFTWARE_HOME%\Zope2\Startup\zopectl.py
"%PYTHON%" "%ZDCTL%" -C "%CONFIG_FILE%" %1 %2 %3 %4 %5 %6 %7
pause


2. Then I tried to run the test according to the README.txt in the Silva 
tests directory, returning an error:

E:\prog\dlcms1.6>bin\zopectl.bat test --dir Products/Silva

E:\prog\dlcms1.6>"C:\prog\Python23\python.exe" 
"E:\prog\Zope-2.8.5-final\lib\pyt
hon\Zope2\Startup\zopectl.py" -C "E:\prog\dlcms1.6\etc\zope.conf" test 
--dir Pro
ducts/Silva
Traceback (most recent call last):
  File "E:\prog\Zope-2.8.5-final\lib\python\Zope2\Startup\zopectl.py", 
line 313,
 in ?
    if os.uname()[0] != 'Darwin':
AttributeError: 'module' object has no attribute 'uname'


Best regards
Sam
_______________________________________________
silva-dev mailing list
silva-dev at infrae.com
https://infrae.com/mailman/listinfo/silva-dev



More information about the silva-dev mailing list