holger krekel avatar holger krekel committed e2a6065

fixes for python 2.4

Comments (0)

Files changed (4)

doc/test/plugin/links.txt

-.. _`pytest_recwarn.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_recwarn.py
-.. _`pytest_iocapture.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_iocapture.py
-.. _`pytest_monkeypatch.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_monkeypatch.py
+.. _`pytest_recwarn.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_recwarn.py
+.. _`pytest_iocapture.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_iocapture.py
+.. _`pytest_monkeypatch.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_monkeypatch.py
 .. _`plugins`: index.html
-.. _`pytest_doctest.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_doctest.py
+.. _`pytest_doctest.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_doctest.py
 .. _`terminal`: terminal.html
 .. _`hooklog`: hooklog.html
-.. _`pytest_restdoc.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_restdoc.py
+.. _`pytest_restdoc.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_restdoc.py
 .. _`xfail`: xfail.html
-.. _`pytest_pocoo.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_pocoo.py
-.. _`pytest_keyword.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_keyword.py
-.. _`pytest_figleaf.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_figleaf.py
-.. _`pytest_hooklog.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_hooklog.py
+.. _`pytest_pocoo.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_pocoo.py
+.. _`pytest_keyword.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_keyword.py
+.. _`pytest_figleaf.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_figleaf.py
+.. _`pytest_hooklog.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_hooklog.py
 .. _`contact`: ../../contact.html
 .. _`pocoo`: pocoo.html
 .. _`checkout the py.test development version`: ../../download.html#checkout
 .. _`oejskit`: oejskit.html
 .. _`unittest`: unittest.html
 .. _`iocapture`: iocapture.html
-.. _`pytest_xfail.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_xfail.py
+.. _`pytest_xfail.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_xfail.py
 .. _`figleaf`: figleaf.html
 .. _`extend`: ../extend.html
-.. _`pytest_terminal.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_terminal.py
+.. _`pytest_terminal.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_terminal.py
 .. _`recwarn`: recwarn.html
-.. _`pytest_pdb.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_pdb.py
+.. _`pytest_pdb.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_pdb.py
 .. _`monkeypatch`: monkeypatch.html
 .. _`resultlog`: resultlog.html
 .. _`keyword`: keyword.html
 .. _`restdoc`: restdoc.html
-.. _`pytest_unittest.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_unittest.py
+.. _`pytest_unittest.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_unittest.py
 .. _`doctest`: doctest.html
-.. _`pytest_resultlog.py`: http://bitbucket.org/hpk42/py-trunk/raw/70c2666f98bce5a86a5554c601c9c1e77dd1d63d/py/test/plugin/pytest_resultlog.py
+.. _`pytest_resultlog.py`: http://bitbucket.org/hpk42/py-trunk/raw/69bd12627e4d304c89c2003842703ccb10dfe838/py/test/plugin/pytest_resultlog.py
 .. _`pdb`: pdb.html

py/test/plugin/pytest_pytester.py

         try:
             args = ['python', str(self.setup_path), 'sdist', 
                     '--dist-dir', str(temp)]
-            subprocess.check_call(args)
+            subcall(args)
             l = temp.listdir('py-*')
             assert len(l) == 1
             sdist = l[0]
         finally:
             temp.remove()
 
+def subcall(args):
+    if hasattr(subprocess, 'check_call'):
+        subprocess.check_call(args)
+    else:
+        subprocess.call(args)
 # code taken from Ronny Pfannenschmidt's virtualenvmanager 
 
 class VirtualEnv(object):
         args = ['virtualenv', self.path]
         if not sitepackages:
             args.append('--no-site-packages')
-        subprocess.check_call(args)
+        subcall(args)
 
     def makegateway(self):
         python = self._cmd('python')

py/test/plugin/pytest_restdoc.py

 
     def register_pygments(self):
         # taken from pygments-main/external/rst-directive.py 
+        from docutils.parsers.rst import directives
         try:
             from pygments.formatters import HtmlFormatter
         except ImportError:
             def pygments_directive(name, arguments, options, content, lineno,
                                    content_offset, block_text, state, state_machine):
                 return []
+            pygments_directive.options = {}
         else:
             # The default formatter
             DEFAULT = HtmlFormatter(noclasses=True)
             }
 
             from docutils import nodes
-            from docutils.parsers.rst import directives
 
             from pygments import highlight
             from pygments.lexers import get_lexer_by_name, TextLexer
                 parsed = highlight(u'\n'.join(content), lexer, formatter)
                 return [nodes.raw('', parsed, format='html')]
 
+            pygments_directive.options = dict([(key, directives.flag) for key in VARIANTS])
+
         pygments_directive.arguments = (1, 0, 1)
         pygments_directive.content = 1
-        pygments_directive.options = dict([(key, directives.flag) for key in VARIANTS])
-
         directives.register_directive('sourcecode', pygments_directive)
 
     def resolve_linkrole(self, name, text, check=True):

py/test/plugin/pytest_runner.py

     config._setupstate = SetupState()
 
 def pytest_sessionfinish(session, exitstatus):
-    # XXX see above
     if hasattr(session.config, '_setupstate'):
         hook = session.config.hook
         rep = hook.pytest__teardown_final(session=session)
         if rep:
             hook.pytest__teardown_final_logerror(rep=rep)
-    # prevent logging module atexit handler from choking on 
-    # its attempt to close already closed streams 
-    # see http://bugs.python.org/issue6333
-    mod = py.std.sys.modules.get("logging", None)
-    if mod is not None: 
-        mod.raiseExceptions = False 
 
 def pytest_make_collect_report(collector):
     result = excinfo = None
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.