Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

chore(ruff): enable test correctness checks (#10542)

Shahmir Varqha4ae0c9decd22
diff --git a/pyproject.toml b/pyproject.toml
index b95c197c0f..e78a0d6fb8 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -391,9 +391,7 @@ ignore = [
"PLW1509", # `subprocess` `preexec_fn` argument
"DTZ002", # `datetime.today()` called without tz
"PLE0704", # Misplaced bare `raise`
- "PLW0129", # Assert on string literal
"PLW0642", # Self or cls assignment
- "PYI006", # Bad `sys.version_info` comparison
"T100", # Debugger
"UP045", # Use `X | None` for optional type annotations
"D421", # Property docstring should not start with a verb (preview rule)
diff --git a/tests/_dependencies/test_dependencies.py b/tests/_dependencies/test_dependencies.py
index 219f2af740..ce9a3effe7 100644
--- a/tests/_dependencies/test_dependencies.py
+++ b/tests/_dependencies/test_dependencies.py
@@ -142,7 +142,10 @@ def test_versions():
why="for testing", min_version="10.0.0"
)
- assert "Mismatched version of test: expected >=2.0.0, got 1.0.0"
+ assert (
+ str(excinfo.value)
+ == f"Mismatched version of altair: expected >=10.0.0, got {version}"
+ )
assert (
DependencyManager.altair.require_at_version(
diff --git a/tests/_runtime/test_trace.py b/tests/_runtime/test_trace.py
index b6eb8145e9..a53f3e965a 100644
--- a/tests/_runtime/test_trace.py
+++ b/tests/_runtime/test_trace.py
@@ -67,12 +67,10 @@ class TestScriptTrace:
# Test col_offset
# Expected output:
# y = y / x
- # ^
+ # ^
# exact line numbers differ by python version
- if sys.version_info == (3, 11):
- assert (
- result.split("y / x")[1].split("\n")[1].startswith(" ^")
- )
+ if (3, 11) <= sys.version_info < (3, 12):
+ assert result.split("y / x")[1].split("\n")[1].startswith(" ^")
@staticmethod
def test_script_trace_with_output() -> None: