Repository navigation
Add a deprecation test that runs the notebooks with the classiq API mocked - #1807
Open
classiqdor wants to merge 8 commits into
Open
classiqdor wants to merge 8 commits into
classiqdor wants to merge 8 commits into
Conversation
Contributor
Author
|
Findings from the full run (a dispatch of this test on every notebook): 38 notebooks fail on a deprecation, and each one is either fixed by an open PR or needs an SDK fix. No third-party deprecation came up.
Not caught by running:
|
…ocked Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ults Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ors, and skip the notebooks the fakes can't run Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… shots than states, and skip adapt_qaoa Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tions Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ields Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
classiqdor
force-pushed
the
deprecations_test
branch
from
November 19, 2026 15:28
5687b7c to
867ea02
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A test that runs every notebook, and the README's code blocks, with the classiq API mocked, and fails on deprecation warnings.
The test (
tests/deprecations/test_deprecations.py) is one parametrized test overiterate_notebooks(), liketest__community_and_functions.py, plus one test for the README. It injects a cell that installs the mock, runs the whole notebook, and fails on:DeprecationWarning,PendingDeprecationWarning,FutureWarning(includingClassiqDeprecationWarning) andSyntaxWarning.The mock (
tests/deprecations/mock_classiq_api.py) runs inside the kernel:sample,ExecutionSession,observe,get_transpiled_circuit_metrics,export, ...). Fakes cover synthesis, sampling, state vectors, estimation, minimization, metrics, export, the legacy VQE flow, the hardware list and RB analysis.main's output values (up to 14 qubits), decoded with the SDK's own parser, so structs, arrays and fixed-point numbers look real. Filters such ascalculate_state_vector(filters=...)are applied.MockedClassiqApiCall, and nothing authenticates.assertstatements are skipped, like withpython -O. This is its own commit, in case we'd rather do this differently.simplefilter("always"), and reported with their notebook cell and source location.Also:
tests/config_deprecations.ini, andtests/deprecationsin the quick tests'norecursedirs.Test-CI-deprecations.yml. The job stays off (if: false). I enabled it temporarily to dispatch full runs, and it's off again.Results. The last full run (about 30 minutes): 173 notebooks pass, 38 fail on a real deprecation (listed in the comments), and 10 are skipped.
Known limits
Preferencesfields) warn only when they're read, not when they're set, so running a notebook can't catch them.RUN_ON_HARDWARE = False), and benchmark notebooks that reuse their saved results, never reach their execution calls.🤖 Generated with Claude Code