Skip to content

Commit

Permalink
Disable python 3.8 incompatible doctest (#2831)
Browse files Browse the repository at this point in the history
  • Loading branch information
sfc-gh-jrose authored Jan 14, 2025
1 parent 5b40dda commit 8581f70
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,27 @@ def pytest_runtest_makereport(item, call):
return tr


# These tests require python packages that are no longer built for python 3.8
PYTHON_38_SKIPS = {
"snowpark.session.Session.replicate_local_environment",
"snowpark.session.Session.table_function",
}

DocTestFinder = doctest.DocTestFinder


class CustomDocTestFinder(DocTestFinder):
def _find(self, tests, obj, name, module, source_lines, globs, seen):
if name in PYTHON_38_SKIPS and sys.version_info < (3, 9):
return
return DocTestFinder._find(
self, tests, obj, name, module, source_lines, globs, seen
)


doctest.DocTestFinder = CustomDocTestFinder


# scope is module so that we ensure we delete the session before
# moving onto running the tests in the tests dir. Having only one
# session is important to certain UDF tests to pass , since they
Expand Down

0 comments on commit 8581f70

Please sign in to comment.