• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

lu-pl / sparqlx / 20406522688
100%

Build:
DEFAULT BRANCH: main
Ran 21 Dec 2025 07:28AM UTC
Jobs 2
Files 8
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

21 Dec 2025 07:27AM UTC coverage: 100.0%. Remained the same
20406522688

push

github

lu-pl
fix: propagate exceptions in ClientManager.context/.acontext

Raising `StopIteration` from a `finally` clause in a
`contextlib.contextmanager` suppresses any Exceptions that occur in
the `with` block. The most serious consquence of this bug in `sparqlx`
is that `raise_for_status` in managed `httpx` clients gets suppressed.

To understand the contextlib.contextmanager behavior, one needs to be aware of the following:

- returning from a generator raises `StopIteration`
- returning True from `__exit__` suppresses Exceptions that occur in the lexical context block; this behavior is intentional and documented, see [Context Managers](https://typing.python.org/en/latest/spec/exceptions.html#context-managers) in the Exceptions Docs.
- `contextlib.contextmanager` needs to suppress `StopIteration` unless it is raised in the `with` block, see [contextlib.py, L163](https://github.com/python/cpython/blob/5b5263648/Lib/contextlib.py#L163).

Since the `finally` clause in the generator-based context manager
abstraction of `contextlib.contextmanager` represents the exit
mechanism of a context manager, `StopIteration` gets raised in
`__exit__` , which is a different case than handling `StopIteration`
in `__exit__` when it was raised in `__enter__`.

Note that `StopIteration` is raised in `sparqlx.utils.ClientManager`
only for managed clients. This is also the reason, why
`httpx.Client.raise_for_status` correctly propagates with user-provided clients!

Closes #94.

295 of 295 relevant lines covered (100.0%)

2.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 20406522688.1 21 Dec 2025 07:28AM UTC 8
100.0
GitHub Action Run
2 20406522688.2 21 Dec 2025 07:29AM UTC 8
100.0
GitHub Action Run
Source Files on build 20406522688
  • Tree
  • List 8
  • Changed 1
  • Source Changed 0
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #20406522688
  • 932006e1 on github
  • Prev Build on main (#20306411418)
  • Next Build on main (#20406536624)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc