Skip to content
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

Adds 'app_name' to urlconf #211

Merged
merged 3 commits into from
Feb 4, 2019
Merged

Adds 'app_name' to urlconf #211

merged 3 commits into from
Feb 4, 2019

Conversation

sobolevn
Copy link
Contributor

@sobolevn sobolevn commented Jan 24, 2019

When using you app like so:

from health_check import urls as health_urls

urlpatterns = [
    # Health checks:
    url(r'^health/', include(health_urls, namespace='health')),
]

Without this property I am getting this warning:

server/urls.py:32
  /Users/sobolev/Desktop/test_project/server/urls.py:32: RemovedInDjango20Warning: Specifying a namespace in django.conf.urls.include() without providing an app_name is deprecated. Set the app_name attribute in the included module, or pass a 2-tuple containing the list of patterns and app_name instead.
    url(r'^health/', include(health_urls, namespace='health')),

-- Docs: https://docs.pytest.org/en/latest/warnings.html

Related: https://stackoverflow.com/questions/48608894/specifying-a-namespace-in-include-without-providing-an-app-name

Copy link
Collaborator

@codingjoe codingjoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch @sobolevn. Would you mind adding the fixing the tests too? They are missing the namespace. Thanks for the contribution!

@sobolevn
Copy link
Contributor Author

sobolevn commented Feb 3, 2019

I have also limited the version of pytest because of this error:

Traceback (most recent call last):
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pluggy/manager.py", line 268, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2345, in load
    self.require(*args, **kwargs)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2368, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pkg_resources/__init__.py", line 789, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pytest 4.2.0 (/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages), Requirement.parse('pytest!=4.2.0,>=3.6'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pytest.py", line 89, in <module>
    raise SystemExit(pytest.main())
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/_pytest/config/__init__.py", line 61, in main
    config = _prepareconfig(args, plugins)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/_pytest/config/__init__.py", line 196, in _prepareconfig
    pluginmanager=pluginmanager, args=args
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pluggy/hooks.py", line 284, in __call__
    return self._hookexec(self, self.get_hookimpls(), kwargs)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pluggy/manager.py", line 68, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pluggy/manager.py", line 62, in <lambda>
    firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pluggy/callers.py", line 203, in _multicall
    gen.send(outcome)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/_pytest/helpconfig.py", line 93, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pluggy/callers.py", line 80, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pluggy/callers.py", line 187, in _multicall
    res = hook_impl.function(*args)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/_pytest/config/__init__.py", line 652, in pytest_cmdline_parse
    self.parse(args)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/_pytest/config/__init__.py", line 838, in parse
    self._preparse(args, addopts=addopts)
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/_pytest/config/__init__.py", line 784, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages/pluggy/manager.py", line 274, in load_setuptools_entrypoints
    message="Plugin %r could not be loaded: %s!" % (ep.name, e),
pluggy.manager.PluginValidationError: Plugin 'django' could not be loaded: (pytest 4.2.0 (/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/lib/python3.6/site-packages), Requirement.parse('pytest!=4.2.0,>=3.6'))!
Coverage.py warning: No data was collected. (no-data-collected)
ERROR: InvocationError for command '/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/bin/coverage run --source=health_check -m pytest --basetemp=/Users/sobolev/Documents/github/django-health-check/.tox/py36-dj111/tmp --ignore=.tox' (exited with code 1)

@sobolevn
Copy link
Contributor Author

sobolevn commented Feb 3, 2019

I have also silenced flake8 to ignore :

from django.utils.translation import ugettext_lazy as _  # noqa: N812

@codecov-io
Copy link

codecov-io commented Feb 3, 2019

Codecov Report

Merging #211 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff            @@
##           master   #211      +/-   ##
========================================
+ Coverage   73.92%    74%   +0.07%     
========================================
  Files          32     32              
  Lines         349    350       +1     
========================================
+ Hits          258    259       +1     
  Misses         91     91
Impacted Files Coverage Δ
health_check/exceptions.py 100% <100%> (ø) ⬆️
health_check/backends.py 100% <100%> (ø) ⬆️
health_check/urls.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 80b5dcc...073bd73. Read the comment docs.

@codingjoe codingjoe merged commit a07434e into revsys:master Feb 4, 2019
@codingjoe
Copy link
Collaborator

Released in 3.9.0

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

Successfully merging this pull request may close these issues.

3 participants