1

I have installed a number of python modules into a common Linux directory that a number of people will be using via an NFS mount (yes I understand that there is a performance hit with this esp with python) I have been able to run the scipy.test('full') as the user that owns the NFS mount as well as root.

Is there a way that I can pass in an argument to the scipy.test() function that will tell it what dir to build the sc_* and linux227compiled_catalog.d* files in? ie scpipt.test('full', /tmp) so that any user who mounts this can run these tests and not have write access to the NFS mount?

Thanks in advance.

4

1 回答 1

0

nvm ...我将以下内容放入测试脚本中:

import scipy
import os
import shutil

directory = os.getcwd()

userHomeDirectory = ( "/home/" + os.getlogin())
userHomeScipyTests = ( userHomeDirectory + "/scipytests" )

#               print ("your current directory location is: " + directory)
print ("Making the following temp folder:  " + userHomeScipyTests )
if (os.path.isdir(userHomeScipyTests)):
        shutil.rmtree(userHomeScipyTests)

os.makedirs ( userHomeScipyTests )
os.chdir( userHomeScipyTests )
print os.getcwd()
output = scipy.test('full')
#               print ("this is the output of the scipy full test: " + str(output.wasSuccessful()))
self.assertEqual(str(output.wasSuccessful()), 'True', 'FullSciPyTest failed')
if (output.wasSuccessful):
print ("Removing the following temp folder: " + userHomeScipyTests )
    shutil.rmtree(userHomeScipyTests)
于 2012-11-14T17:59:40.093 回答