Skip to content

import_plugin hides exception source #2491

@RonnyPfannschmidt

Description

@RonnyPfannschmidt
Traceback (most recent call last):
  File "/home/rpfannsc/Projects/pytest-dev/pytest-venv/bin/pytest", line 11, in <module>
    load_entry_point('pytest', 'console_scripts', 'pytest')()
  File "/home/rpfannsc/Projects/pytest-dev/pytest-venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 560, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/home/rpfannsc/Projects/pytest-dev/pytest-venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2648, in load_entry_point
    return ep.load()
  File "/home/rpfannsc/Projects/pytest-dev/pytest-venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2302, in load
    return self.resolve()
  File "/home/rpfannsc/Projects/pytest-dev/pytest-venv/lib/python3.5/site-packages/pkg_resources/__init__.py", line 2308, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/home/rpfannsc/Projects/pytest-dev/pytest/pytest.py", line 76, in <module>
    _preloadplugins()  # to populate pytest.* namespace so help(pytest) works
  File "/home/rpfannsc/Projects/pytest-dev/pytest/_pytest/config.py", line 117, in _preloadplugins
    _preinit.append(get_config())
  File "/home/rpfannsc/Projects/pytest-dev/pytest/_pytest/config.py", line 126, in get_config
    pluginmanager.import_plugin(spec)
  File "/home/rpfannsc/Projects/pytest-dev/pytest/_pytest/config.py", line 444, in import_plugin
    raise new_exc
ImportError: Error importing plugin "unittest": cannot import name 'fail'

as an example

its not that helpful to get the traceback cut at a bad location

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: bugproblem that needs to be addressedtype: infrastructureimprovement to development/releases/CI structure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions