01-arcadia.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. --- contrib/python/pytest-localserver/py3/pytest_localserver/https.py (index)
  2. +++ contrib/python/pytest-localserver/py3/pytest_localserver/https.py (working tree)
  3. @@ -10,1 +10,1 @@ import os.path
  4. -_ROOT = os.path.abspath(os.path.dirname(__file__))
  5. +_ROOT = os.getcwd()
  6. --- contrib/python/pytest-localserver/py3/pytest_localserver/plugin.py (index)
  7. +++ contrib/python/pytest-localserver/py3/pytest_localserver/plugin.py (working tree)
  8. @@ -4,6 +4,9 @@
  9. #
  10. # This program is release under the MIT license. You can find the full text of
  11. # the license in the LICENSE file.
  12. +import os
  13. +import pkgutil
  14. +
  15. import pytest
  16. @@ -62,11 +65,17 @@ def httpsserver(request):
  17. SSL encryption.
  18. """
  19. from pytest_localserver import https
  20. -
  21. - server = https.SecureContentServer()
  22. - server.start()
  23. - request.addfinalizer(server.stop)
  24. - return server
  25. + try:
  26. + with open(https.DEFAULT_KEY, 'wb') as f:
  27. + f.write(pkgutil.get_data('pytest_localserver', 'server.key'))
  28. + with open(https.DEFAULT_CERTIFICATE, 'wb') as f:
  29. + f.write(pkgutil.get_data('pytest_localserver', 'cert.crt'))
  30. + server = https.SecureContentServer()
  31. + server.start()
  32. + request.addfinalizer(server.stop)
  33. + yield server
  34. + finally:
  35. + os.remove(https.DEFAULT_CERTIFICATE)
  36. @pytest.fixture