[haiku-bugs] Re: [Haiku] #6755: Python's test_os.py fails self.assertEquals(st2.st_mtime, int(st.st_mtime-delta))

  • From: "dsizzle" <trac@xxxxxxxxxxxx>
  • Date: Thu, 10 Mar 2016 07:27:17 -0000

#6755: Python's test_os.py fails self.assertEquals(st2.st_mtime, 
int(st.st_mtime-
delta))
-----------------------+----------------------------
   Reporter:  scottmc  |      Owner:  nobody
       Type:  bug      |     Status:  new
   Priority:  normal   |  Milestone:  R1
  Component:  System   |    Version:  R1/Development
 Resolution:           |   Keywords:
 Blocked By:           |   Blocking:
Has a Patch:  0        |   Platform:  All
-----------------------+----------------------------

Comment (by dsizzle):

 For this line: self.assertEquals(st2.st_mtime, int(st.st_mtime-delta))

 ...if we're casting the second argument to int, why not just cast the
 first to int as well?

 self.assertEquals(int(st2.st_mtime), int(st.st_mtime-delta))

 that doesn't seem to break the spirit of the test in my opinion...if
 st2.st_mtime is returning a float then comparing to an int expression is
 *never* going to work anyway.

--
Ticket URL: <https://dev.haiku-os.org/ticket/6755#comment:7>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: