01-arcadia.patch 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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. -DEFAULT_CERTIFICATE = os.path.join(os.path.abspath(os.path.dirname(__file__)), "server.pem")
  5. +DEFAULT_CERTIFICATE = os.path.join(os.getcwd(), "server.pem")
  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,15 @@ 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_CERTIFICATE, 'wb') as f:
  27. + f.write(pkgutil.get_data('pytest_localserver', 'server.pem'))
  28. + server = https.SecureContentServer()
  29. + server.start()
  30. + request.addfinalizer(server.stop)
  31. + yield server
  32. + finally:
  33. + os.remove(https.DEFAULT_CERTIFICATE)
  34. @pytest.fixture