名称错误:导入随机时jython中的挂起弃用警告

时间:2012-09-06 11:43:04

标签: python jython grinder jython-2.5

我正在使用脚本运行grinder但是当我运行它时抛出这个异常。可以任何人请让我知道什么是错的?为什么不随机导入。谢谢

Error running worker process (NameError: PendingDeprecationWarning 
    File "C:\jython2.5.2\Lib\warnings.py", line 265, in ? 
    File "C:\jython2.5.2\jython\Lib\random.py", line 41, in ? 
    File "C:\webservice\testRandomise.py", line 4, in ?

我通过控制台和座席

运行研磨机

我的环境  //setGrinderEnv.cmd

set GRINDERPATH=C:\\grinder-3.10
set HELLOWORLDIMPL=C:\src\main\java\com\webservice
set GRINDERPROPERTIES=C:\grinder-3.10\examples\grinder.properties
set CLASSPATH=%GRINDERPATH%\lib\grinder.jar;%GRINDERPATH%\lib\m-0.0.1-SNAPSHOT.jar;%CLASSPATH%
PATH=%JAVA_HOME%\bin;%PATH%

// startAgent.cmd

call C:\grinder-3.10\setGrinderEnv.cmd
echo %CLASSPATH%
java -cp %CLASSPATH% net.grinder.Grinder %GRINDERPROPERTIES%

// startConsole.cmd

call C:\grinder-3.10\setGrinderEnv.cmd
java -cp %CLASSPATH% net.grinder.Console

我正在运行以下脚本

#
# testRandomise.py
#
import random
import string

class TestRandomise:
def __init__(self, filename):
self._users = []
infile = open(filename, "r")

for line in infile.readlines():
  self._users.append(string.split((line),','))
infile.close()

  def getUserInfo(self):
"Pick a random (user) from the list."
return random.choice(self._users)

 from testRandomise import TestRandomise
 tre = TestRandomise("users.txt")

 class TestRunner:
 def __call__(self):
    # Get user for this run.
    (user) = tre.getUserInfo()

0 个答案:

没有答案