Skip to content

ImportWarning with PYTHONWARNINGS=all #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jleclanche opened this issue Jun 23, 2017 · 2 comments
Closed

ImportWarning with PYTHONWARNINGS=all #495

jleclanche opened this issue Jun 23, 2017 · 2 comments

Comments

@jleclanche
Copy link

I like to use PYTHONWARNINGS=all for my test runs. Unfortunately, anything that uses pytest-django includes a ton of warnings from pytest_django/plugin.py:

/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/_pytest/assertion/rewrite.py:7: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:17: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .django_compat import is_django_unittest  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:18: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import django_db_setup  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/fixtures.py:9: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from . import live_server_helper
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/fixtures.py:11: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .django_compat import is_django_unittest
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/fixtures.py:12: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .pytest_compat import getfixturevalue
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/fixtures.py:14: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .lazy_django import get_django_version, skip_if_no_django
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:19: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import django_db_use_migrations  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:20: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import django_db_keepdb  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:21: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import django_db_modify_db_settings  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:22: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import django_db_modify_db_settings_xdist_suffix  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:23: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import _live_server_helper  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:24: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import admin_client  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:25: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import admin_user  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:26: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import client  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:27: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import db  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:28: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import django_user_model  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:29: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import django_username_field  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:30: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import live_server  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:31: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import rf  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:32: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import settings  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:33: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .fixtures import transactional_db  # noqa
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:34: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .pytest_compat import getfixturevalue
/home/adys/src/django/django-intenumfield/.tox/py36-django111/lib/python3.6/site-packages/pytest_django/plugin.py:36: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  from .lazy_django import (django_settings_is_configured,

Any idea why?

@pelme
Copy link
Member

pelme commented Jul 4, 2017

I can reproduce this with export PYTHONWARNINGS=all and running pytest in the pytest-django test suite.

This is probably another problem because of #415.

@blueyed
Copy link
Contributor

blueyed commented Jul 4, 2017

Closing this as dupe of #415.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants