conftest.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #
  2. # Copyright 2018-2022 Elyra Authors
  3. #
  4. # Licensed under the Apache License, Version 2.0 (the "License");
  5. # you may not use this file except in compliance with the License.
  6. # You may obtain a copy of the License at
  7. #
  8. # http://www.apache.org/licenses/LICENSE-2.0
  9. #
  10. # Unless required by applicable law or agreed to in writing, software
  11. # distributed under the License is distributed on an "AS IS" BASIS,
  12. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. # See the License for the specific language governing permissions and
  14. # limitations under the License.
  15. #
  16. import os
  17. import shutil
  18. import pytest
  19. @pytest.fixture
  20. def setup_factory_data(jp_environ, jp_env_jupyter_path):
  21. """Copies the factory metadata instances for runtime-images and compontent-registries to test hierarchy."""
  22. source = os.path.join(os.path.dirname(__file__), "..", "..", "..", "etc/config/metadata")
  23. destination = os.path.join(jp_env_jupyter_path, "metadata")
  24. shutil.copytree(source, destination)
  25. yield destination # this return value probably won't be used, but here nonetheless
  26. # Set Elyra server extension as enabled (overriding server_config fixture from jupyter_server)
  27. @pytest.fixture
  28. def jp_server_config(setup_factory_data):
  29. return {"ServerApp": {"jpserver_extensions": {"elyra": True}}}