Skip to content

[CLIENT-4702] Convert docstring code examples to doctest format and validate them#1047

Draft
juliannguyen4 wants to merge 72 commits intodevfrom
CLIENT-4702-doc-validate-code-examples-using-doctest
Draft

[CLIENT-4702] Convert docstring code examples to doctest format and validate them#1047
juliannguyen4 wants to merge 72 commits intodevfrom
CLIENT-4702-doc-validate-code-examples-using-doctest

Conversation

@juliannguyen4
Copy link
Copy Markdown
Collaborator

@juliannguyen4 juliannguyen4 commented Apr 26, 2026

Extra Changes

  • Add ability to copy code examples while also stripping any characters that aren't valid Python syntax

Trade-offs

  • Code examples are harder to run because the Python REPL gives a syntax error when it encounters >>>. As a workaround, developers have to use IPython REPL with their specific desired version of Python to copy and run the code examples

https://aerospike-python-client--1047.org.readthedocs.build/en/1047/aerospike.html

TODO

  • aerospike needs to be compiled before running doctest
  • Copying doctest formatted code into Python REPL causes syntax errors related to >>> Moved to a different format than doctest
  • Doctest teardown

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Apr 26, 2026

Codecov Report

❌ Patch coverage is 0% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.85%. Comparing base (6570acb) to head (e36bc42).
⚠️ Report is 5 commits behind head on dev.

Files with missing lines Patch % Lines
src/main/client/operate.c 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1047      +/-   ##
==========================================
- Coverage   83.89%   83.85%   -0.04%     
==========================================
  Files          99       99              
  Lines       14514    14520       +6     
==========================================
  Hits        12176    12176              
- Misses       2338     2344       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

…the TLS test which needs to be run with a different job
…uple that contains the line number where it happened which isn't important
… run boilerplate code before each example in client.rst
…y code example. It doesn't seem possible with doctest + unittest
…this setting to run aerospike_helper API methods
…est can run the code examples and aerospike_helpers doesn't use a mocked out aerospike when it does exist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants