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

hypothesis / h / 10539 / 1
69%
master: 97%

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

24 Feb 2016 10:14AM UTC coverage: 69.36%. First build
10539.1

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.

2816 of 4060 relevant lines covered (69.36%)

0.69 hits per line

Source Files on job 10539.1
  • Tree
  • List 0
  • Changed 0
  • Source Changed 0
  • Coverage Changed 0
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 10539
  • Travis Job 10539.1
  • 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