Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2024 01:56 AM
Hey,
Did you manage to solve this issue? I am experiencing the same error but under a different context of using pytest in a notebook.
My scenario:
import pytest
import os
import sys
os.chdir(f'/Workspace/Shared/DataTechnology-Databricks-Core')
# Skip writing pyc files on a readonly filesystem.
sys.dont_write_bytecode = True
# Run pytest.
retcode = pytest.main([".", "-v", "-p", "no:cacheprovider", " --import-mode=importlib"])
# Fail the cell execution if there are any test failures.
assert retcode == 0, "The pytest invocation failed. See the log for details."And when I run it I get the error:
ImportError while loading conftest '/Workspace/Shared/DataTechnology-Databricks-Core/tests/conftest.py'.
AttributeError: 'ImportHookFinder' object has no attribute 'find_spec'
AssertionError: The pytest invocation failed. See the log for details.
---------------------------------------------------------------------------
AssertionError Traceback (most recent call last)
File <command-2886421435072391>, line 12
10 retcode = pytest.main([".", "-v", "-p", "no:cacheprovider", " --import-mode=importlib"])
11 # Fail the cell execution if there are any test failures.
---> 12 assert retcode == 0, "The pytest invocation failed. See the log for details."
AssertionError: The pytest invocation failed. See the log for details.