We are currently working on porting this changelog to the specifications in Keep a Changelog. This project adheres to Semantic Versioning.
- Added the
REQUIRE_WANTruntime directive. When enabled, a doctest part that produces stdout or an evaluated value must provide an explicit local want. It can be enabled for a whole run through the existing generic directive options, or scoped to a block or individual part. - Added the
deferred_output_matchingconfig knob and CLI flags to opt into stdlib/doctest-like output grouping without changing the default xdoctest behavior. - Added structured intake helpers for stdlib-shaped
doctest.Exampleanddoctest.DocTestobjects, preserving one-based source locations, complete stdlib option masks (includingSKIP), and per-example output, report-style, and option boundaries without rewriting user source. - Added
IGNORE_WARNINGSandSHOW_WARNINGSruntime directives for per-example warning policy. - Added native doctest interoperability primitives, including stdlib-shaped
output-checker and optionflag registration APIs and the
FLOAT_CMPandIGNORE_OUTPUTdirectives. - Added support for module-level
__doctest_skip__and__doctest_requires__metadata. Bare module or distribution requirements remain zero-dependency; version-constrained requirements use the optionalpackagingdependency.
- Fixed issue #181 where comment indentation could cause parsing issues.
- Fix traceback rewriting for exceptions raised in earlier doctest parts
- Ignored output from a no-want part is discarded rather than deferred to a later trailing match.
- Issue where inline REQUIRES directives caused errors. (bug introduced in 2693ea4 2019-07-16)
- Cached static module doctest metadata using file identity, and report specific
__doctest_skip__and__doctest_requires__reasons through pytest. - Native xdoctest output checks now keep structured runtime state on the fast path. Stdlib optionflag conversion occurs only for foreign checkers or sparse compatibility mappings. The native checker name is reserved; foreign checker classes retain factory semantics and are materialized once per doctest run.
- Bump minimum pytest to 6.2.5
- Much more static typing
- Correctly find line numbers for decorated
async deffunctions (without crashing).
- Static discovery now includes doctests defined in
async deffunctions.
- New
ASYNCbasic directive to hold the asyncio event loop in any section of code. Useful for multitasking tests. - Support for 3.14
- Removed
16806_WORKAROUNDas it is not longer needed for Python 3.8+ - Removed deprecated --xdoc-force-dynamic and --allow-xdoc-dynamic flags
- Improved speed (~6x) of doctest collection when running in pytest
- Uses pytest plugin system to disable stdlib doctest instead of monkey patching.
- Fixed incorrect return type in docstrings
- The doctest parser no longer expand tabs to spaces
- Support for top level awaits in async code examples.
- Dropped 3.6 and 3.7 support. Now supporting 3.8+ Use xdoctest<=1.1.6 for 3.6 or 3.7 support.
- Fixed passing of
flagsas keyword argument tore.subfor python 3.13 compliance.
- Minor modification to
xdoctest --version-infoand exposed it in CLI help.
modname_to_modpathfixed in cases where editable installs use type annotations in their MAPPING definition.
- Working around a
modname_to_modpathissue.
modname_to_modpathnow handles cases where editable packages have modules where the name is different than the package.- Update
xdoctest.pluginto support pytest 8.0 - Fixed deprecated usage of
ast.Num
- Partial support for 3.12. New f-string syntax is not supported yet.
- Removed dependency on six and got rid of old Python 2 logic
- Binary tests are now only run on "full" installs to reduce minimal dependencies.
- Support for Python 3.11
- Minor typing fixes
- Can now handle basic versions of the new
__editable__package finder mechanism. - Parsing bug where directives were incorrectly flagged as inline if they were directly followed by a function with a decorator.
- Dropped 2.7 and 3.5 support. Now supporting 3.6+ Use xdoctest<=1.0.2 for 2.7 or 3.5 support.
- Improved the "dump" functionality of converting doctests to unit tests.
- Environs as options:
XDOCTEST_VERBOSE,XDOCTEST_OPTIONS,XDOCTEST_GLOBAL_EXEC,XDOCTEST_REPORT,XDOCTEST_STYLE, andXDOCTEST_ANALYSISenvironment variables can now be used to specify configuration defaults.
- Added experimental hidden feature
--insert-skip-directive-above-failuresthat can be used to modify your code such that failing doctests are marked as skip. - Disabled traceback suppression on module import errors (this is is
configurable via the
supress_import_errorsoption). - Xdoctest will no longer try to pre-import the module if none of its doctests have any enabled lines. This also means global-exec statements will NOT run for those tests, which means you can no longer use global-exec to force enabling tests.
- Add type stubs
- Basic support for pyproject.toml under
tool.xdoctest. Currently only supports options in the native runner.
- Corner case bug in error reporting
- Doctests that never run any code are now correctly marked as skipped
- Issue where the "dumps" command was undocumented and has an error.
- Moved some globals into a new module called
global_stateand allowed environs to enable debug print statements. - Added
util_deprecationmodule to robustly mark features as deprecated. - Modified the google style return type parser to return a type if the only content is some parsable python code.
- Modified docscrape google to allow for parsing of
*argsand**kwargsin args blocks. This has also moved to the standalone packagegoogledoc - Overhaul of repo structure in an effort to modernize and to agree with templates defined by xcookie
- Module code now lives in the "src" directory to remove install vs develop ambiguity.
- Support for Python 3.10
- Warning in pytest8
- Spelling errors in documentation
- The xdoctest "analysis" option now defaults to "auto" everywhere.
- Fix issue #112
--analysis=dynamicargument is now respected
- Added GitHub actions to the CI
- Disabled workaround 16806 in Python 3.8+
- New CI GPG Keys: Erotemic-CI: 70858F4D01314BF21427676F3D568E6559A34380 for reference the old signing key was 98007794ED130347559354B1109AC852D297D757.
- Fixed minor test failures
- Fixed #106 - an issue to do with compiling multiline statements in single mode.
- Fixed #108 - an issue to do with compiling semicolon token in eval mode.
- Removed the distracting and very long internal traceback that occurred in pytest when a module errors while it is being imported before the doctest is run.
- Pytest now defaults to
--xdoctest-verbose=2by default (note this does nothing unless-sis also given so pytest does not suppress output)
- Bug in REQUIRES state did not respect
python_implementationarguments - Ported sphinx fixes from ubelt
-
Directive syntax errors are now handled as doctest runtime errors and return better debugging information.
-
README and docs were improved
- Better message when a pytest skip or exit-test-exception occurs
- Suppressed warning about using internal
FixtureRequest
- Minor issues with release tarballs.
- Color issues on win32
- Moved to CircleCI deploy scripts
- Bug where references to doctest variables were never released
- Documentation improvements
- Minor text fixes
pip install xdoctestcan now specify[colors]or[jupyter]- Enhanced REQUIRES directive behavior, multiple comma-separated requirements can now be listed in one directive.
- Xdoctest can now be run inside of Jupyter notebooks / IPython sessions
- Xdoctest can now be run on Jupyter notebooks (Note that in general it is better practice to write a module)
- Bug in
doctest_callablewhere it would not populate globals from the function context.
- Renamed
ConfigtoDoctestConfig - Renamed
static_analysis.parse_calldefstostatic_analysis.parse_static_calldefs. A temporary function with the old name is exposed for backwards compatibility. - Changed argument name from
modpath_or_nametomodule_identifierin several functions. This is to better indicate its coercible nature as either a module path, a module name. This change impactsdoctest_module,parse_doctestables,package_calldefs.
- The REQUIRES directive can now inspect existence or values of environment variables.
- Added top-level
doctest_callablefunction, which executes the doctests of a function or class. - Support for
NO_COLORenvironment variable.
IPython.embedandipdb.launch_ipdb_on_exceptionnow correctly work from inside doctests.- Small incompatibility with
pytest-matrix. See #82
xdoctest.runner.doctest_modulenow accepts the module object itself.- Zero-args doctests no longer capture stdout (this prevents IPython embedding issues).
- Fixed minor bug in zero args runner when captured stdout is None
- We now ignore doctests in setters and deleters to prevent them from clobbering doctests in getters.
- CLI support for doctest "analysis" mode (which can be either static or dynamic).
- Google docstrings now allow for leading whitespace in the description.
- Support python
3.9.0a5whenevalreturns a coroutine (tentative). - Use
from_parentconstructors forpytestmodules when possible. Fixes deprecation warning.
- better docs
- support for numpy and RST example blocks
- make
xdoctest -m xdoctest.__init__ __doc__:0work likexdoctest -m xdoctest/__init__.py __doc__:0
- Add CI support for PyPy
- Add CI support for CPython 3.8
- Added tox
- REQUIRES directive now supports CPython, IronPython, Jython, and PyPy
- REQUIRES directive now supports PY2, PY3
- The verbose flag was previously not taken into account. This is now fixed.
- The
--xdoc-globlist of patterns now defaults to empty. In general it is not safe to assume a default pattern. This means the user must opt-in to testing text files as if they were doctests.
PythonPathContextnow works in more corner cases, although some rarer corner cases will now break. This trade-off should be a net positive.- Releases are handled by TravisCI and will be signed with the GPG key 98007794ED130347559354B1109AC852D297D757 (note we will rotate this key in 1 year). <- (2021-09-06) lol that did not happen, someday I'll get around to setting up rotating GPG keys.
- Can now specify zero-args as the command to the xdoctest CLI to run all zero-args functions in a file.
- Add known issue: note about possible want-reporting bug.
- More docstrings
- Add
--versionoption to CLI interface
- You no longer need a comment to denote that a
...is a continuation and not a ellipsis. (i.e. you don't need to write... #) - Want statements will check against return values in nested continuations
- Cleaned up internal code, private APIs may break.
- Failed doctests will now print their original line prefixes (either
>>>or...when possible)
run_tests.pynow returns the correct error code. (fixes CircleCI)- Fixed outdated docs in the directive file
- Improved backwards compatibility. Explicit continuations now work more similarly to the original doctest.
- You no longer need a comment to denote that a
...is a continuation and not a ellipsis. - Want statements will check against return values in nested continuations
- Removed debug print
- Add skip count to the native runner
-
Renamed several functions in various classes to be private. Its unlikely anyone was externally using them. The change functions include:
DoctestExample:pre_run->_pre_runDoctestExample:post_run->_post_runDirective:unpack_args->_unpack_argsDirective:state_item->effect
-
Modified behavior of
RuntimeState.updateto use the directive effect. -
Added explicit REQUIRES runtime-state, which maintains a set of unmet conditions. When non-empty it behaves like SKIP.
- The REQUIRES directive no longer clobbers the previous SKIP state.
- The native runner now exits with a non-zero error code on failure
- Slight modifications to file structure
- Inherit
util_importfromubelt
- Fixed issue with nested functions and exec in older python versions
- Fixed issue in modsplit with multidot suffixes.
- Minor fixes to readme and docs
- Added docs! Finally!
- Got-want exceptions now return a special error if it fails to create a string-representation of the object instead of crashing.
- The
indexargument inimport_module_from_pathis now correctly used.
- The REQUIRES directive can now accept python modules in the form:
# xdoctest: +REQUIRES(module:<my_modname>) - Support for double-colon example syntax in google style parsing: e.g.
Example::.
- Demo folder illustrating how xdoctest formats error messages
- Reduced import overhead time from 20ms to 1ms.
- Removed warning if
pygmentsis not installed
- Changed verbosity defaults
- Added
global-execto native xdoctest CLI andxdoctest-global-execto thepytestplugin CLI
- Renamed
DocTest.globstoDocTest.global_namespace - Internal test changes
- Fixed issue in
tracebackparsing that sometimes caused incorrectly offset line numbers.
- Fixed bug in
static_analysis.is_balanced_statementandstatic_analysis.extract_commentshaving to do with empty lines - Fixed odd corner case where
import_module_from_pathseemed to modifysys.pathin a specific environment - Fixed Python2 future issues using the print name in doctests.
- Added option to print test times in the runner.
- Fixed python2 unicode error in collection phase
- Added nocolor command line arg
- Added parserkw arg
- Python 3.7 support
- Better error messages when you forget a raw string on a google block with newlines in the docstr.
- Tests for malformed google docstr case.
- Fixed install issues (/introduced hack FIXME later)
- Fixed issue with raw string lineno parsing
- Added config option for lineno offsets. (corresponding arguments added to native and pytest runners)
- Partial support for Python 3.7
-
Generally Improved doctest error reporting
- Includes better coloring for quick visual inspection
- Line numbers are now reported in a more intuitive way
- We finally removed the exec
DoctestExample.runfrom the traceback!
-
(we report line numbers of errors in a more intuitive way).
- Fixed GH#20 where
doclineno_endwas incorrectly parsed - Fixed issue where google style block lineno was incorrect
- Fixed bug with reporting elapsed time in native runner
- Added auto parsing style. This first tries to use Google, but falls back on freeform if no google-style doctests are found.
- Errors are no longer printed twice if only a single test is being run.
- Added command "dump" to native runner that reformats enabled doctests so they can be run as unit tests.
- Implemented delayed want matching. This enables doctests to use multiple print statements in a row and use a single want statement to check all of their output.
- All parsers now default to the new "auto" style.
- Colorized doctest now highlights "want" lines in a distinct (green) color
- Changed development status to Beta
- Output difference now strips the
BLANKLINEmarker if enabled
- The reported difference between got and want now preserves newlines for better visibility.
- Fixed bug where pytest would collect all tests twice
(because the
__init__.pyfile was normalized to a directory inpackage_modpaths)
- API update to facilitate
mkinit
- Improved doctest syntax error message
PythonPathContextno longer breaks if small changes to the path occur in its context.PythonPathContextcan now insert into front or back of sys.path- Flags can now be specified before or after positional arguments when using the main script
- Added entry point script
- example command lines now use the full path if the module is not in the
PYTHONPATH - Can now override
sys.pathwhen callingmodname_to_modpathandis_modname_importable(API change)
- added
IGNORE_WANTdirective - added separator between printout of docsrc and its stdout
- Print correct doctest line number in the traceback
- Runner
on_errorwill now default to return instead of raise
- Fixed option parsing bug in main script
- The default runtime state can be customized with the
xdoc-optionscommand line argument.
- Fix crash when trying to read binary files
- Fix issue in
_docstr_line_workaround
- Starting keeping a changelog, all changes before this point are only documented via the git history.
- Undocumented changes
- Undocumented changes
- First release