Merge lp:~cjwatson/storm/capture-tracer-modern-fixtures into lp:storm

Proposed by Colin Watson
Status: Merged
Merged at revision: 559
Proposed branch: lp:~cjwatson/storm/capture-tracer-modern-fixtures
Merge into: lp:storm
Diff against target: 45 lines (+3/-6)
3 files modified
NEWS (+1/-0)
setup.py (+1/-4)
storm/testing.py (+1/-2)
To merge this branch: bzr merge lp:~cjwatson/storm/capture-tracer-modern-fixtures
Reviewer Review Type Date Requested Status
Ioana Lasc (community) Approve
Storm Developers Pending
Review via email: mp+384555@code.launchpad.net

Commit message

Convert CaptureTracer to the improved API in fixtures >= 1.3.0.

Description of the change

As the fixtures CHANGES file says:

* Fixture.setUp should no longer be overridden in subclasses. Instead
  override _setUp. This permits the Fixture base class to detect failures
  during _setUp and trigger any registered cleanups, attach any details
  to the failure exception and propagate that to callers. Overriding of
  setUp is still supported: this adds a new interface for simpler
  implementation of the contract of a fixture.
  (Robert Collins, #1456361, #1456353)

fixtures 1.3.0 was released in 2015.

My main immediate motivation for this was to stop CaptureTracer.setUp showing up in API documentation.

To post a comment you must log in.
Revision history for this message
Ioana Lasc (ilasc) wrote :

makes sense and looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS'
2--- NEWS 2020-05-26 10:28:24 +0000
3+++ NEWS 2020-05-26 15:57:50 +0000
4@@ -5,6 +5,7 @@
5 ------------
6
7 - Add Sphinx documentation.
8+- Convert CaptureTracer to the improved API in fixtures >= 1.3.0.
9
10 Bug fixes
11 ---------
12
13=== modified file 'setup.py'
14--- setup.py 2020-05-26 10:28:24 +0000
15+++ setup.py 2020-05-26 15:57:50 +0000
16@@ -24,15 +24,12 @@
17
18
19 tests_require = [
20- # Versions based on Lucid, where packaged.
21- "fixtures >= 0.3.5",
22- # pgbouncer (the Python module) is not yet packaged in Ubuntu.
23+ "fixtures >= 1.3.0",
24 "pgbouncer >= 0.0.7",
25 "postgresfixture",
26 "psycopg2 >= 2.3.0",
27 "testresources >= 0.2.4",
28 "testtools >= 0.9.8",
29- # timeline is not yet packaged in Ubuntu.
30 "timeline >= 0.0.2",
31 "transaction >= 1.0.0",
32 "twisted >= 10.0.0",
33
34=== modified file 'storm/testing.py'
35--- storm/testing.py 2020-05-26 10:37:54 +0000
36+++ storm/testing.py 2020-05-26 15:57:50 +0000
37@@ -21,8 +21,7 @@
38 super(CaptureTracer, self).__init__()
39 self.queries = []
40
41- def setUp(self):
42- super(CaptureTracer, self).setUp()
43+ def _setUp(self):
44 install_tracer(self)
45 self.addCleanup(remove_tracer, self)
46

Subscribers

People subscribed via source and target branches

to status/vote changes: