Skip to content

Issue with pastebin option in astropy.test() with Python 3.2 #51

Closed

Description

@astrofrog

As of 7946471, when using astropy.test(pastebin='failed'), an exception related to XML is raised:

============================================================================ Sending information to Paste Service =============================================================================
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
/Users/tom/<ipython-input-3-144d52ea8b0a> in <module>()
----> 1 astropy.test(pastebin='failed')

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/tests/helper.py in run_tests(module, args, plugins, verbose, pastebin, remote_data)
    121         all_args += ' --remotedata'
    122 
--> 123     return pytest.main(args=all_args, plugins=plugins)
    124 
    125 

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in main(args, plugins)
    455         config = hook.pytest_cmdline_parse(
    456                 pluginmanager=_pluginmanager, args=args)
--> 457         exitstatus = hook.pytest_cmdline_main(config=config)
    458     except UsageError:
    459         e = sys.exc_info()[1]

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in __call__(self, **kwargs)
    409     def __call__(self, **kwargs):
    410         methods = self.hookrelay._pm.listattr(self.name)
--> 411         return self._docall(methods, kwargs)
    412 
    413     def pcall(self, plugins, **kwargs):

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in _docall(self, methods, kwargs)
    420         mc = MultiCall(methods, kwargs, firstresult=self.firstresult)
    421         try:
--> 422             res = mc.execute()
    423             if res:
    424                 self.trace("finish", self.name, "-->", res)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in execute(self)
    338             method = self.methods.pop()
    339             kwargs = self.getkwargs(method)
--> 340             res = method(**kwargs)
    341             if res is not None:
    342                 self.results.append(res)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.main in pytest_cmdline_main(config)
     88 
     89 def pytest_cmdline_main(config):
---> 90     return wrap_session(config, _main)
     91 
     92 def _main(config, session):

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.main in wrap_session(config, doit)
     82     if initstate >= 2:
     83         config.hook.pytest_sessionfinish(session=session,
---> 84             exitstatus=session.exitstatus)
     85     if initstate >= 1:
     86         config.pluginmanager.do_unconfigure(config)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in __call__(self, **kwargs)
    409     def __call__(self, **kwargs):
    410         methods = self.hookrelay._pm.listattr(self.name)
--> 411         return self._docall(methods, kwargs)
    412 
    413     def pcall(self, plugins, **kwargs):

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in _docall(self, methods, kwargs)
    420         mc = MultiCall(methods, kwargs, firstresult=self.firstresult)
    421         try:
--> 422             res = mc.execute()
    423             if res:
    424                 self.trace("finish", self.name, "-->", res)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in execute(self)
    338             method = self.methods.pop()
    339             kwargs = self.getkwargs(method)
--> 340             res = method(**kwargs)
    341             if res is not None:
    342                 self.results.append(res)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.terminal in pytest_sessionfinish(self, exitstatus, __multicall__)
    316             self.summary_errors()
    317             self.summary_failures()
--> 318             self.config.hook.pytest_terminal_summary(terminalreporter=self)
    319         if exitstatus == 2:
    320             self._report_keyboardinterrupt()

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in __call__(self, **kwargs)
    409     def __call__(self, **kwargs):
    410         methods = self.hookrelay._pm.listattr(self.name)
--> 411         return self._docall(methods, kwargs)
    412 
    413     def pcall(self, plugins, **kwargs):

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in _docall(self, methods, kwargs)
    420         mc = MultiCall(methods, kwargs, firstresult=self.firstresult)
    421         try:
--> 422             res = mc.execute()
    423             if res:
    424                 self.trace("finish", self.name, "-->", res)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.core in execute(self)
    338             method = self.methods.pop()
    339             kwargs = self.getkwargs(method)
--> 340             res = method(**kwargs)
    341             if res is not None:
    342                 self.results.append(res)

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.pastebin in pytest_terminal_summary(terminalreporter)
     49         if tr.config.option.debug:
     50             terminalreporter.write_line("xmlrpcurl: %s" %(url.xmlrpc,))
---> 51         serverproxy = getproxy()
     52         for rep in terminalreporter.stats.get('failed'):
     53             try:

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/_pytest.pastebin in getproxy()
     39 
     40 def getproxy():
---> 41     return py.std.xmlrpclib.ServerProxy(url.xmlrpc).pastes
     42 
     43 def pytest_terminal_summary(terminalreporter):

/Users/tom/Library/Python/3.2/lib/python/site-packages/astropy-0.0dev_r255-py3.2-macosx-10.6-x86_64.egg/astropy/extern/pytest.py/py._std in __getattr__(self, name)
     13             m = __import__(name)
     14         except ImportError:
---> 15             raise AttributeError("py.std: could not import %s" % name)
     16         return m
     17 

AttributeError: py.std: could not import xmlrpclib

@jiffyclub - Is this fixable, or do we need to report this as a bug in py.test?

Activity

  1. jiffyclub commented on Nov 7, 2011

    @jiffyclub
    Contributor

    My guess is a bug, but I'm not an expert in Python 3. Could you try it with an installed py.test, instead of the astropy packaged py.test, and see whether the same thing happens?

  2. embray commented on Nov 7, 2011

    @embray
    Member

    This would be a py.test bug I think. In Python 3 xmlrpclib became just xmlrpc. So py.test should be doing a different import for Python 3.

  3. eteq commented on Nov 9, 2011

    @eteq
    Member

    Is this something we can monkeypatch to get around, or should we just close this but for now? (or wait until py.test fixes it?)

  4. jiffyclub commented on Nov 9, 2011

    @jiffyclub
    Contributor

    It may be possible to fix this in our packaged py.test by getting and fixing the source code, then regenerating the stand-alone script. I will give that a shot and see what happens. If I get it working I can also give the fix back to py.test.

  5. astrofrog commented on Nov 9, 2011

    @astrofrog
    MemberAuthor

    @eteq - I think we should definitely keep this ticket open until the issue is fixed either by us or by the py.test developers.

    @jiffyclub - great!

  6. jiffyclub commented on Nov 15, 2011

    @jiffyclub
    Contributor

    This issue has been fixed in the py.test trunk but I don't know when the next official release will be. I haven't tested it yet with our py.test standalone script due to problems getting the latest astropy built on my computer. Once I've verified that the standalone script is working in both Python 2 and Python 3 I'll open a pull request with the new py.test script and we can close this one, unless we want to leave it open until pastebin also works in a py.test official release.

  7. added a commit that references this issue on Oct 9, 2013
    7a0f944
  8. added a commit that references this issue on Jan 23, 2015
  9. added a commit that references this issue on Jul 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions