Back to index

plone3  3.1.7
Public Member Functions
jsbase.conftest.JSChecker Class Reference

List of all members.

Public Member Functions

def __repr__
def setup
def teardown
def run
def join

Detailed Description

Definition at line 103 of file conftest.py.


Member Function Documentation

Definition at line 104 of file conftest.py.

00104 
00105     def __repr__(self): 
00106         return py.test.collect.Collector.__repr__(self) 

def jsbase.conftest.JSChecker.join (   self,
  name 
)

Definition at line 149 of file conftest.py.

00149 
00150     def join(self, name):
00151         if py.path.local(name).dirpath().strpath.endswith('.js'):
00152             return JSTest(name, self)
00153         return super(JSChecker, self).join(name)

Definition at line 113 of file conftest.py.

00113 
00114     def run(self): 
00115         findjs = here.join('testing/findtests.js').read() % (
00116                     self.fspath.strpath, '__main__')
00117         curdir = str(py.path.local('.'))
00118         py.std.os.chdir(str(self.fspath.dirpath()))
00119         tests = []
00120         try:
00121             jspath = self.fspath.new(basename='__findtests.js')
00122             try:
00123                 jspath.write(findjs)
00124                 stdin, pipe, stderr = py.std.os.popen3('js "%s"' % (jspath,))
00125                 try:
00126                     error = stderr.next()
00127                     print 'Error read:', error
00128                 except StopIteration:
00129                     pass
00130                 else:
00131                     if error.find('command not found') > -1:
00132                         py.test.skip(
00133                             'error running "js" (SpiderMonkey), which is '
00134                             'required to run JS tests')
00135                     else:
00136                         py.test.fail(error)
00137                     return
00138                 try:
00139                     for line in pipe:
00140                         tests.append(line.strip())
00141                 finally:
00142                     py.std.sys.stdout = py.std.sys.__stdout__
00143                     pipe.close()
00144             finally:
00145                 jspath.remove()
00146         finally:
00147             py.std.os.chdir(curdir)
00148         return ['%s/%s' % (self.fspath.basename, test) for test in tests]

Definition at line 107 of file conftest.py.

00107 
00108     def setup(self): 
00109         pass 

Definition at line 110 of file conftest.py.

00110 
00111     def teardown(self): 
00112         pass 


The documentation for this class was generated from the following file: