<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Did some googling and it looks like 2.6 doesn't support assertRaises as a context manager.<div><br></div><div><br><div apple-content-edited="true">
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; ">PCM (Paul Michali)<br><br></span></div><div><div>On Feb 8, 2013, at 1:17 PM, Paul Michali wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">I'm working on a bug and I had this code, which passes UT on my system running python2.7, but fails Jenkin's python2.6 run:<div><br></div><div><div><div> def test_missing_required_config(self):</div><div> args = ['--config-file',</div><div> os.path.join(TEST_ETC_AREA, 'bad-quantum.conf.test')]</div><div> with self.assertRaises(cfg.RequiredOptError):</div><div> config.parse(args=args)</div></div><div><br></div><div>First Jenkins failure (looks like python2.6) says:</div><div><br></div><div><pre style="color: rgb(0, 0, 0); font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px;">ft116.1: quantum.tests.unit.test_config.RequiredConfigTest.test_missing_required_configTraceback (most recent call last):
File "/usr/lib/python2.6/unittest.py", line 279, in run
testMethod()
File "/home/jenkins/workspace/gate-quantum-python26/quantum/tests/unit/test_config.py", line 59, in test_missing_required_config
with self.assertRaises(cfg.RequiredOptError):
TypeError: failUnlessRaises() takes at least 3 arguments (2 given)
</pre><pre style="color: rgb(0, 0, 0); font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: left; text-indent: 0px; text-transform: none; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><font class="Apple-style-span" face="Helvetica">Is there an issue with 2.6 supporting with clause and assertRaises, or is there a backward compatibility issue? I'm trying changing it to this...</font></pre></div><div><br></div><div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><font class="Apple-style-span" size="3"> <span style="color: #063ff4">def</span> <b>test_missing_required_config</b>(<i>self</i>):</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><font class="Apple-style-span" size="3"> args = [<span style="color: #00b339"><i>'--</i></span><span style="text-decoration: underline ; color: #00b339"><i>config</i></span><span style="color: #00b339"><i>-file'</i></span>,</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><font class="Apple-style-span" size="3"> os.path.join(TEST_ETC_AREA, <span style="color: #00b339"><i>'bad-quantum.conf.test'</i></span>)]</font></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 10px/normal Helvetica; "><font class="Apple-style-span" size="3"> <i>self</i>.assertRaises(cfg.RequiredOptError, config.parse, args=args)</font></div></div><div><br></div><div><br></div><div apple-content-edited="true">
PCM (Paul Michali)<br><br></div></div></div></blockquote></div><br></div></body></html>