OK can someone please review?<div><br></div><div><a href="https://github.com/cmello/IronLanguages-main/commit/0d9cad9e1ef203df6131b9d44013a0e0f31b8088">https://github.com/cmello/IronLanguages-main/commit/0d9cad9e1ef203df6131b9d44013a0e0f31b8088</a> </div>
<div><br></div><div>The test passes but I still don't know if/where to enable that test in the build?</div><div><br></div><div>Thank you.</div><div><br></div><div>Best regards</div><div>Mello<br><br><div class="gmail_quote">
On Sat, Mar 3, 2012 at 12:57 PM, Cesar Mello <span dir="ltr"><<a href="mailto:cmello@gmail.com">cmello@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I could run the test using the command line:<div><br></div><div><div>D:\workspace-git\IronLanguages-main\Languages\IronPython\Internal>ipy ..\..\..\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py</div>
</div><div><br></div><div>And then got 4 failures, including the one I want to fix:</div><div><br></div><div><div>======================================================================</div><div>ERROR: test_total_seconds (__main__.TestTimeDelta)</div>
<div>----------------------------------------------------------------------</div><div>Traceback (most recent call last):</div><div> File "..\..\..\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py", line 269, in test_total_seconds</div>
<div> self.assertEqual(td.total_seconds(), 31536000.0)</div><div>AttributeError: 'timedelta' object has no attribute 'total_seconds'</div><div><br></div><div>======================================================================</div>
</div><div><br></div><div><br></div><div>Just couldn't figure out yet how to run all the IronPython tests at once.</div><div><br></div><div>Best regards</div><span class="HOEnZb"><font color="#888888"><div>Mello</div>
</font></span><div class="HOEnZb"><div class="h5"><div><br><div class="gmail_quote">On Sat, Mar 3, 2012 at 12:08 PM, Cesar Mello <span dir="ltr"><<a href="mailto:cmello@gmail.com" target="_blank">cmello@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<div><br></div><div>Any help here is appreciated. </div><div><br></div><div>I found a related unit test here:</div>
<div>
<br></div><div>main\External.LCA_RESTRICTED\Languages\IronPython\27\Lib\test\test_datetime.py:</div>
<div><br></div><div><div> def test_total_seconds(self):</div><div> td = timedelta(days=365)</div><div> self.assertEqual(td.total_seconds(), 31536000.0)</div><div> for total_seconds in [123456.789012, -123456.789012, 0.123456, 0, 1e6]:</div>
<div> td = timedelta(seconds=total_seconds)</div><div> self.assertEqual(td.total_seconds(), total_seconds)</div><div> # Issue8644: Test that td.total_seconds() has the same</div><div> # accuracy as td / timedelta(seconds=1).</div>
<div> for ms in [-1, -2, -123]:</div><div> td = timedelta(microseconds=ms)</div><div> self.assertEqual(td.total_seconds(),</div><div> ((24*3600*td.days + td.seconds)*10**6</div>
<div> + td.microseconds)/10**6)</div></div><div><br></div><div><br></div><div>I would like to know how to enable and run this in the build.</div><div><br></div><div>Thank you very much.</div>
<span><font color="#888888"><div>
Mello</div></font></span><div><div><div><br></div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Fri, Mar 2, 2012 at 2:10 PM, Jeff Hardy <span dir="ltr"><<a href="mailto:jdhardy@gmail.com" target="_blank">jdhardy@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Just an oversight. Can you open an issue on <a href="http://ironpython.codeplex.com" target="_blank">ironpython.codeplex.com</a>?<br>
Should be easy enough to get this in. If you're up to it, a pull<br>
request would be even better :)<br>
<br>
- Jeff<br>
<div><div><br>
On Fri, Mar 2, 2012 at 8:54 AM, Cesar Mello <<a href="mailto:cmello@gmail.com" target="_blank">cmello@gmail.com</a>> wrote:<br>
> Hi!<br>
><br>
> This method doesn't seem to be implemented. From<br>
> <a href="http://docs.python.org/library/datetime.html" target="_blank">http://docs.python.org/library/datetime.html</a> :<br>
> timedelta.total_seconds()<br>
><br>
> Return the total number of seconds contained in the duration. Equivalent to<br>
> (td.microseconds + (td.seconds + td.days * 24 * 3600) * 10**6) /10**6<br>
> computed with true division enabled.<br>
><br>
> Note that for very large time intervals (greater than 270 years on most<br>
> platforms) this method will lose microsecond accuracy.<br>
><br>
> New in version 2.7.<br>
><br>
><br>
> Best regards!<br>
> Mello<br>
><br>
</div></div>> _______________________________________________<br>
> Ironpython-users mailing list<br>
> <a href="mailto:Ironpython-users@python.org" target="_blank">Ironpython-users@python.org</a><br>
> <a href="http://mail.python.org/mailman/listinfo/ironpython-users" target="_blank">http://mail.python.org/mailman/listinfo/ironpython-users</a><br>
><br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>