conftest.py 474 B

123456789101112131415161718192021222324
  1. # -*- coding: utf-8 -*-
  2. import pytest
  3. from requests.compat import urljoin
  4. def prepare_url(value):
  5. # Issue #1483: Make sure the URL always has a trailing slash
  6. httpbin_url = value.url.rstrip('/') + '/'
  7. def inner(*suffix):
  8. return urljoin(httpbin_url, '/'.join(suffix))
  9. return inner
  10. @pytest.fixture
  11. def httpbin(httpbin):
  12. return prepare_url(httpbin)
  13. @pytest.fixture
  14. def httpbin_secure(httpbin_secure):
  15. return prepare_url(httpbin_secure)