Loading ...
Sorry, an error occurred while loading the content.

[Cheetahtemplate-discuss] cheetah test Failure

Expand Messages
  • Robert Uhl
    I ve cheetah 0.9.15 with Python 2.2.2 running on top of Red Hat s 9.0 (patched up) Linux distro, and I get the following when I run cheetah test. Ccs would be
    Message 1 of 2 , Oct 10, 2003
    • 0 Attachment
      I've cheetah 0.9.15 with Python 2.2.2 running on top of Red Hat's 9.0
      (patched up) Linux distro, and I get the following when I run cheetah
      test. Ccs would be nice, as I'm not subscribed to the list yet. Danke
      schön.

      .........................................................................................................................................................................................................................................................E...E...E........................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................................
      **********************************************************************
      ERROR Cheetah.Tests.SyntaxAndOutput.ExtendsDirective.test4 (#extends SampleBaseClass without #import)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 1986, in test4
      '<img src="spacer.gif" width="1" height="1" alt="" />\n')
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 146, in verify
      self._gen(input)
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 154, in _gen
      settings=self.settings(),
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 156, in __init__
      self.compile(source, file)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 245, in compile
      compiler.compile()
      File "/usr/lib/python2.2/site-packages/Cheetah/Compiler.py", line 1086, in compile
      self.parse()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1036, in parse
      self.eatDirective()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1150, in eatDirective
      self.directiveEaters[directiveKey]()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1470, in eatExtends
      mod = self._templateObj._importAsDummyModule('\n'.join(self._importStatements))
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 454, in _importAsDummyModule
      mod = self._impModFromDummyPackage(packageName, tmpFilename)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 496, in _impModFromDummyPackage
      moduleDir, forceReload=1)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 526, in _importModuleFromDirectory
      module = imp.load_module(fullModuleName, fp, pathname, stuff)
      File "/tmp/__CheetahTemp_2003101021481335145.py", line 13, in ?
      from SampleBaseClass import SampleBaseClass
      ImportError: No module named SampleBaseClass

      **********************************************************************
      ERROR Cheetah.Tests.SyntaxAndOutput.ExtendsDirective_MacEOL.test4 (#extends SampleBaseClass without #import)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 1986, in test4
      '<img src="spacer.gif" width="1" height="1" alt="" />\n')
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 146, in verify
      self._gen(input)
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 154, in _gen
      settings=self.settings(),
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 156, in __init__
      self.compile(source, file)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 245, in compile
      compiler.compile()
      File "/usr/lib/python2.2/site-packages/Cheetah/Compiler.py", line 1086, in compile
      self.parse()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1036, in parse
      self.eatDirective()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1150, in eatDirective
      self.directiveEaters[directiveKey]()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1470, in eatExtends
      mod = self._templateObj._importAsDummyModule('\n'.join(self._importStatements))
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 454, in _importAsDummyModule
      mod = self._impModFromDummyPackage(packageName, tmpFilename)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 496, in _impModFromDummyPackage
      moduleDir, forceReload=1)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 526, in _importModuleFromDirectory
      module = imp.load_module(fullModuleName, fp, pathname, stuff)
      File "/tmp/__CheetahTemp_2003101021481371316.py", line 13, in ?
      from SampleBaseClass import SampleBaseClass
      ImportError: No module named SampleBaseClass

      **********************************************************************
      ERROR Cheetah.Tests.SyntaxAndOutput.ExtendsDirective_Win32EOL.test4 (#extends SampleBaseClass without #import)
      ----------------------------------------------------------------------
      Traceback (most recent call last):
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 1986, in test4
      '<img src="spacer.gif" width="1" height="1" alt="" />\n')
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 146, in verify
      self._gen(input)
      File "/usr/lib/python2.2/site-packages/Cheetah/Tests/SyntaxAndOutput.py", line 154, in _gen
      settings=self.settings(),
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 156, in __init__
      self.compile(source, file)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 245, in compile
      compiler.compile()
      File "/usr/lib/python2.2/site-packages/Cheetah/Compiler.py", line 1086, in compile
      self.parse()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1036, in parse
      self.eatDirective()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1150, in eatDirective
      self.directiveEaters[directiveKey]()
      File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1470, in eatExtends
      mod = self._templateObj._importAsDummyModule('\n'.join(self._importStatements))
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 454, in _importAsDummyModule
      mod = self._impModFromDummyPackage(packageName, tmpFilename)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 496, in _impModFromDummyPackage
      moduleDir, forceReload=1)
      File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 526, in _importModuleFromDirectory
      module = imp.load_module(fullModuleName, fp, pathname, stuff)
      File "/tmp/__CheetahTemp_2003101021481391345.py", line 13, in ?
      from SampleBaseClass import SampleBaseClass
      ImportError: No module named SampleBaseClass

      ----------------------------------------------------------------------
      Ran 1242 tests in 30.275s

      FAILED (errors=3)


      --
      Robert Uhl <ruhl@...>
      Give a small boy a hammer and he will find that everything he
      encounters needs pounding.


      -------------------------------------------------------
      This SF.net email is sponsored by: SF.net Giveback Program.
      SourceForge.net hosts over 70,000 Open Source Projects.
      See the people who have HELPED US provide better services:
      Click here: http://sourceforge.net/supporters.php
      _______________________________________________
      Cheetahtemplate-discuss mailing list
      Cheetahtemplate-discuss@...
      https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
    • Mike Orr
      ... I don t know then. There are various errors some people have in the tests regarding temporary modules, but since they don t happen to me I can t pin down
      Message 2 of 2 , Oct 14, 2003
      • 0 Attachment
        On Tue, Oct 14, 2003 at 08:49:26AM -0600, Robert Uhl wrote:
        > Mike Orr <mso@...> writes:
        > >
        > > > I've cheetah 0.9.15 with Python 2.2.2 running on top of Red Hat's 9.0
        > > > (patched up) Linux distro, and I get the following when I run cheetah
        > > > test. Ccs would be nice, as I'm not subscribed to the list yet. Danke
        > > > sch?n.
        > > >
        > > > ImportError: No module named SampleBaseClass
        > >
        > > Do you have write permission in the current directory?
        >
        > Yup; in my home directory. Here's the output again, as this time I
        > ensured that I ran it from my home, rather than elsewhere:
        >
        > **********************************************************************
        > ERROR Cheetah.Tests.SyntaxAndOutput.ExtendsDirective.test4 (#extends SampleBaseClass without #import)
        ...
        > File "/usr/lib/python2.2/site-packages/Cheetah/Parser.py", line 1470, in eatExtends
        > mod = self._templateObj._importAsDummyModule('\n'.join(self._importStatements))
        > File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 454, in _importAsDummyModule
        > mod = self._impModFromDummyPackage(packageName, tmpFilename)
        > File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 496, in _impModFromDummyPackage
        > moduleDir, forceReload=1)
        > File "/usr/lib/python2.2/site-packages/Cheetah/Template.py", line 526, in _importModuleFromDirectory
        > module = imp.load_module(fullModuleName, fp, pathname, stuff)
        > File "/tmp/__CheetahTemp_2003101408470599889.py", line 13, in ?
        > from SampleBaseClass import SampleBaseClass
        > ImportError: No module named SampleBaseClass

        I don't know then. There are various errors some people have in the
        tests regarding temporary modules, but since they don't happen to me I
        can't pin down what's happening. I'd be curious to see the content of
        this temporary module it's executing
        (/tmp/__CheetahTemp_2003101408470599889.py).

        Does SampleBaseClass.py exist? I'd presume it would be in the current
        directory, but you can verify by adding
        print "Current directory is", os.getcwd()
        print "SampleBaseClass.py exist? ", os.path.exists('SampleBaseClass.py')
        in Cheetah/Tests/SyntaxAndOutput.py line 1949
        (class ExtendsDirective, method setUp)
        The output will appear somewhere above the traceback.

        setUp creates this file before each ExtendsDirective test, and tearDown
        deletes it.

        Does sys.path include a '' entry, and/or does PYTHONPATH include a '.'
        entry? I think Python does this automatically, but it's necessary to
        make modules in the current directory importable.

        Note that this is really one error, not three. All tests are run three
        times, using the Unix, Windows and Mac end-of-line conventions in the
        source templates. So the same error is being hit three times.

        I'd ignore the problem. Whatever it is, it's unlikely to appear in
        your templates. #extends can be touchy because it depends on a lot of
        things being just right. But it's much easier to troubleshoot a
        real-world scenario than the artificial environment the test uses as an
        approximation. I'm tempted to just disable the test. I haven't been
        keeping track of exactly which tests generate the file not found/module
        not found errors, but if it turns out to always be this test, maybe the
        test is more useless than it's worth.

        --
        -Mike Orr (aka. Sluggo), mso@... (iron@...)
        http://iron.cx/ English * Esperanto * Russkiy * Deutsch * Espan~ol


        -------------------------------------------------------
        This SF.net email is sponsored by: SF.net Giveback Program.
        SourceForge.net hosts over 70,000 Open Source Projects.
        See the people who have HELPED US provide better services:
        Click here: http://sourceforge.net/supporters.php
        _______________________________________________
        Cheetahtemplate-discuss mailing list
        Cheetahtemplate-discuss@...
        https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss
      Your message has been successfully submitted and would be delivered to recipients shortly.