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

hypothesis / h / 10539
69%
master: 97%

Build:
Build:
LAST BUILD BRANCH: realtime-update-v1-h-only-1
DEFAULT BRANCH: master
Ran 24 Feb 2016 10:22AM UTC
Jobs 1
Files 109
Run time 2s
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

pending completion
10539

push

travis-ci

nickstenning
Ensure request session is correctly committed in non-web contexts

f0c96f2 changed the relationship between the transaction manager and the
SQLAlchemy session so that it became possible to fetch a session that
wasn't managed by the transaction manager. (This is useful for the
websocket server, which manages its own database session.)

Unfortunately, this introduced a rather unpleasant bug, whereby if
during the course of a request nobody accessed the session as
`request.db` (using the base model `query` property exclusively, for
example) then the session would never get tied to the transaction
manager and would be dropped when the request ended.

This commit fixes that by moving the code that registers the session
with the transaction manager into a NewRequest subscriber, which ensures
that it happens on every request. This has the downside of requiring a
session be constructed for every request, but there's no easy way around
this while we use the magic session query property.

Pyramid doesn't run NewRequest subscribers when creating a request
manually using `Request.blank` as we currently do in `h.script` and
`h.worker`, so these environments must manually commit the open database
transaction.

11 of 11 new or added lines in 3 files covered. (100.0%)

2816 of 4060 relevant lines covered (69.36%)

0.69 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
100.0
h/script.py
3
100.0
h/db.py
6
100.0
h/notification/worker.py
Jobs
ID Job ID Ran Files Coverage
1 10539.1 24 Feb 2016 10:22AM UTC 0
69.36
Travis Job 10539.1
Source Files on build 10539
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #10539
  • dd5dd94d on github
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