Comments (7)
Oh yes, now that you mention it, I remember this and it's a pretty frustating bug in pytest:
pytest-dev/pytest#4954 (comment)
Please follow up there in the hope it might get some priority :-)
from sybil.
Can you give a simple example or two of what you're looking to do and what your proposed solution would look like?
from sybil.
I tried to do this:
.. invisible-code-block: python
remember_me = b'see how namespaces work?'
>>> remember_me
b'see how namespaces work?'
or
.. invisible-code-block: python
remember_me = b'see how namespaces work?'
::
>>> remember_me
b'see how namespaces work?'
But I am told that “remember_me” is undefined, because it seems to work only for code-block
, which does not allow to perform output check, as far as I know.
from sybil.
I'll looks like you're missing the whitespace line after .. invisible-code-block
, here's an example of invisible code blocks and doctest sections interacting on the same namespace:
https://github.com/Simplistix/testfixtures/blob/master/docs/comparing.txt#L440-L464
What test runner are you using? pytest -v
shows what blocks are being picked up, if your invisible code block isn't there, it's not correctly formatted.
from sybil.
It works indeed. Thanks!!!
from sybil.
For the record, I believe the underlying issue was not actually Sybil, but pytest using regular doctest. I was accidentally combining both type of tests, Sybil’s were picking up the hidden code, but doctest’s was not, and I though it was Sybil as well.
from sybil.
Following up on this a long while later, adding addopts = -p no:doctest
to your pytest config gets its doctest parser out of the way.
from sybil.
Related Issues (20)
- ModuleNotFoundError if pytest is not installed HOT 5
- Support GitHub Flavored Markdown (GFM)
- Request: Add test which fails if `self.evaluator = None` is removed HOT 2
- Parse and export directive options, too HOT 18
- `skip: next` now seems to require an empty line after it HOT 2
- Pytest 8 error: FixtureManager.getfixtureclosure() missing 1 required positional argument: 'ignore_args' HOT 14
- Support for `testcode` and `testoutput` in `DocTestDirectiveParser`s HOT 6
- MyST lexer can't handle code fences with additional backticks HOT 5
- sdist is missing some files needed for testing HOT 3
- Regression: Fails handling triple backquotes with lang tag HOT 13
- pytest: `IndexError: list index out of range` when filtering traceback at `tb_entry = tb[1]` HOT 5
- Escapes inside docstring cause Sybil to fail HOT 3
- Discussion: Using multiple evaluators on the same region HOT 28
- Colored output in Python 3.13 causes Sybil to fail HOT 4
- Add support for the `code` MyST directive HOT 1
- Add support for the `.. code::` reStructuredText directive HOT 1
- TypeError related to FixtureManager.getfixtureclosure() on v7.0.0 HOT 5
- Docstring collection failure with ellipsis HOT 2
- Add a maximum version to pytest dependency for the pytest extra HOT 3
- AttributeError on bad skip comment HOT 9
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 sybil.