[py-svn] r61765 - in py/branch/pytestplugin/py: apigen apigen/testing bin

hpk at codespeak.net hpk at codespeak.net
Thu Feb 12 01:57:28 CET 2009


Author: hpk
Date: Thu Feb 12 01:57:26 2009
New Revision: 61765

Modified:
   py/branch/pytestplugin/py/apigen/apigen.py
   py/branch/pytestplugin/py/apigen/htmlgen.py
   py/branch/pytestplugin/py/apigen/testing/test_apigen_example.py
   py/branch/pytestplugin/py/bin/gendoc.py
Log:
a few tweaks to get some tests somewhat going


Modified: py/branch/pytestplugin/py/apigen/apigen.py
==============================================================================
--- py/branch/pytestplugin/py/apigen/apigen.py	(original)
+++ py/branch/pytestplugin/py/apigen/apigen.py	Thu Feb 12 01:57:26 2009
@@ -26,9 +26,9 @@
 
 def get_documentable_items(pkgdir):
     pkgname, pkgdict = get_documentable_items_pkgdir(pkgdir)
-    from py.__.execnet.channel import Channel
-    pkgdict['execnet.Channel'] = Channel
-    Channel.__apigen_hide_from_nav__ = True
+    #from py.__.execnet.channel import Channel
+    #pkgdict['execnet.Channel'] = Channel
+    #Channel.__apigen_hide_from_nav__ = True
     return pkgname, pkgdict
 
 def sourcedirfilter(p):

Modified: py/branch/pytestplugin/py/apigen/htmlgen.py
==============================================================================
--- py/branch/pytestplugin/py/apigen/htmlgen.py	(original)
+++ py/branch/pytestplugin/py/apigen/htmlgen.py	Thu Feb 12 01:57:26 2009
@@ -430,8 +430,9 @@
             relpath = get_rel_sourcepath(self.projroot, sourcefile, sourcefile)
             text = 'source: %s' % (relpath,)
             if is_in_pkg:
-                href = self.linker.get_lazyhref(sourcefile,
-                                                self.get_anchor(func))
+                #href = self.linker.get_lazyhref(sourcefile,
+                #                                self.get_anchor(func))
+                href = self.linker.get_lazyhref(sourcefile) # 
         csource = H.SourceSnippet(text, href, colored)
         cslinks = self.build_callsites(dotted_name)
         snippet = H.FunctionDescription(localname, argdesc, docstring,
@@ -464,8 +465,8 @@
             if sourcefile[-1] in ['o', 'c']:
                 sourcefile = sourcefile[:-1]
             sourcelink = H.div(H.a('view source',
-                href=self.linker.get_lazyhref(sourcefile,
-                                              self.get_anchor(cls))))
+                href=self.linker.get_lazyhref(sourcefile) #, self.get_anchor(cls)
+            ))
 
         snippet = H.ClassDescription(
             # XXX bases HTML

Modified: py/branch/pytestplugin/py/apigen/testing/test_apigen_example.py
==============================================================================
--- py/branch/pytestplugin/py/apigen/testing/test_apigen_example.py	(original)
+++ py/branch/pytestplugin/py/apigen/testing/test_apigen_example.py	Thu Feb 12 01:57:26 2009
@@ -11,8 +11,6 @@
 from py.__.apigen.conftest import option
 from py.__.path.svn.testing.svntestbase import make_test_repo
 
-py.test.skip("apigen needs work on py.test to work again")
-
 def run_string_sequence_test(data, seq):
     currpos = -1
     for s in seq:
@@ -238,7 +236,8 @@
         self.linker.replace_dirpath(self.base, False)
         funchtml = self.base.join('api/main.SomeClass.html').read()
         print funchtml
-        assert funchtml.find('href="../source/pkg/someclass.py.html#SomeClass"') > -1
+        #assert funchtml.find('href="../source/pkg/someclass.py.html#SomeClass"') > -1
+        assert funchtml.find('href="../source/pkg/someclass.py.html"') > -1
         _checkhtml(funchtml)
 
     def test_build_namespace_pages(self):

Modified: py/branch/pytestplugin/py/bin/gendoc.py
==============================================================================
--- py/branch/pytestplugin/py/bin/gendoc.py	(original)
+++ py/branch/pytestplugin/py/bin/gendoc.py	Thu Feb 12 01:57:26 2009
@@ -45,7 +45,7 @@
     if apigendir.check():
         print apigendir, "exists, not re-generating - remove to trigger regeneration"
     else:
-        sysexec('%(env)s %(pytest)s --apigen=%(pypath)s/apigen/apigen.py py' % locals())
+        sysexec('%(env)s %(pytest)s py' % locals())
     print 
     print "*" * 30, "static generation", "*" * 30
     sysexec('%(env)s %(pytest)s --forcegen %(pypath)s/doc' % locals())



More information about the pytest-commit mailing list