Merge lp:~exarkun/divmod.org/nevow-do-not-segfault into lp:divmod.org

Proposed by Jean-Paul Calderone on 2014-06-07
Status: Merged
Approved by: Tristan Seligmann on 2014-06-07
Approved revision: 2746
Merged at revision: 2746
Proposed branch: lp:~exarkun/divmod.org/nevow-do-not-segfault
Merge into: lp:divmod.org
Prerequisite: lp:~exarkun/divmod.org/nevow-setup.py-declare-twisted-dependency
Diff against target: 35 lines (+8/-12)
2 files modified
Nevow/nevow/test/segfault.py (+0/-11)
Nevow/nevow/test/test_testutil.py (+8/-1)
To merge this branch: bzr merge lp:~exarkun/divmod.org/nevow-do-not-segfault
Reviewer Review Type Date Requested Status
Tristan Seligmann 2014-06-07 Approve on 2014-06-07
Review via email: mp+222432@code.launchpad.net

Commit message

Get rid of the very unsafe `nevow.test.segfault` module and instead have the test which previously used it generate the code it needs when it runs.

To post a comment you must log in.
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== removed file 'Nevow/nevow/test/segfault.py'
2--- Nevow/nevow/test/segfault.py 2009-07-04 00:32:14 +0000
3+++ Nevow/nevow/test/segfault.py 1970-01-01 00:00:00 +0000
4@@ -1,11 +0,0 @@
5-#!/usr/bin/python
6-
7-"""
8-Generate an unhandled SIGSEGV for this process immediately upon import.
9-
10-@see: L{nevow.test.test_testutil.JavaScriptTests.test_signalledExit}.
11-"""
12-
13-import os, signal
14-
15-os.kill(os.getpid(), signal.SIGSEGV)
16
17=== modified file 'Nevow/nevow/test/test_testutil.py'
18--- Nevow/nevow/test/test_testutil.py 2010-02-06 04:33:05 +0000
19+++ Nevow/nevow/test/test_testutil.py 2014-06-07 13:01:05 +0000
20@@ -188,7 +188,14 @@
21 An error should be reported if the JavaScript interpreter exits because
22 it received a signal.
23 """
24- segfault = FilePath(__file__).sibling('segfault.py')
25+ segfault = FilePath(self.mktemp())
26+ segfault.setContent("""\
27+#!/usr/bin/python
28+# Generate an unhandled SIGSEGV for this process immediately upon import.
29+
30+import os, signal
31+os.kill(os.getpid(), signal.SIGSEGV)
32+""")
33
34 def stubFinder():
35 return sys.executable

Subscribers

People subscribed via source and target branches