Comments (4)
There is a problem with applying this to non-test functions. We do not want to replace docstrings of library functions if doctests are skipped.
Also, what is the solution for conditional skipping of module-level doctests?
from cpython.
Or instead of patching the string, we can go with .__doctest_skip__
attribute for a function.
from cpython.
There is a problem with applying this to non-test functions. We do not want to replace docstrings of library functions if doctests are skipped.
Hm, indeed. This might be a bit more complex: we can add # doctest: +SKIP
to all >>>
lines dynamically.
Does not seem too hard, but it will be harder for sure.
Also, what is the solution for conditional skipping of module-level doctests?
This can be adjusted to include doctest.skip_if(condition, module=True)
.
from cpython.
This was my idea too. I thought about making it more general and also setting other options for the whole test, but I don't see a use case for other options for now.
Alternative ideas:
- Introduce a special exception
doctest.SkipTest
, so that raising it will skip all following examples. - Introduce a syntax for conditional skipping, e.g.
+SKIP if varname
. It is enough to support only simple variable names, not complex expressions. It would be nice to also add syntax to apply options to all subsequent examples instead of just one example.
They are more complex changes of doctest
machinery.
from cpython.
Related Issues (20)
- Tkinter: emit deprecation warning for trace_variable() etc HOT 2
- Overriding SIGINT doesn't work as expected in the new REPL HOT 4
- flowgraph.c: push_cold_blocks_to_end: Assertion `prev_instr' failed HOT 1
- test_sendfile_close_peer_in_the_middle_of_receiving fails with Linux 6.10 release candidates and non-4KiB page size
- pickling & deepcopy of rruleset and rrule with cache HOT 3
- urllib.parse.urlsplit has trouble with basic auth passwords that contain hashtags HOT 4
- `test_datetime` does not respect custom `setUpClass` and `tearDownClass`
- `re.sub()` leaks references
- Enhancement for OrderedDict: Add `reorder_by_values` method HOT 2
- Add a `commands` argument to `pdb.Pdb` so the user can feed commands from source code
- Windows Python help raises NameError because of missing underscore HOT 1
- .ass files give incorrect MIME types HOT 3
- `_utcfromtimestamp` is undefined in `datetimetester`
- ``date.fromtimestamp(None)`` behaves differently between ``_pydatetime`` and ``_datetime``
- Python 3.13 beta 2 fails to build when --enable-experimental-jit is attempted -- FIXED HOT 5
- Fix incorrect `email.header.Header` `maxlinelen` default. HOT 1
- ‘resource_tracker.py’ warns for multiple leaked objects even if only single leak during multiprocessing
- asyncio.Runner explicitly checks for coroutine HOT 8
- Intel-suffixed free-threading macOS universal builds missing HOT 1
- macOS: python3t shortcuts missing(?) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cpython.