[tor-bugs] #5493 [Stem]: run_tests.py fails on Windows

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Sun Apr 8 21:50:34 UTC 2012


#5493: run_tests.py fails on Windows
----------------------+-----------------------------------------------------
 Reporter:  reganeet  |          Owner:  atagar           
     Type:  defect    |         Status:  needs_information
 Priority:  normal    |      Milestone:                   
Component:  Stem      |        Version:                   
 Keywords:            |         Parent:                   
   Points:            |   Actualpoints:                   
----------------------+-----------------------------------------------------

Comment(by atagar):

 Thanks. It looks like platform.system() == os.uname()[0], at least for
 Linux and Mac. At some point we should check that this holds true for
 FreeBSD and OpenBSD but I'd be surprised if it doesn't. Replaced all
 os.uname() usage so those unit tests should be fine now.

 > Looking at the stacktraces, we should be using os.path.join() which
 combines the components intelligently based on the operating system
 instead of hardcoding the paths.

 Actually, it *is* using os.path.join() in expand_path. The trouble is that
 (a) the test doesn't mock os.path.sep and (b) the expand_path function is
 unix specific.

 I've fixed 'a' and addressed 'b' by making the function a no-op on
 Windows. At some point we should make it work on Windows but at the moment
 nothing vital relies on it and dealing with things like the "C:\" prefix
 will be a minor pita.


 The unit tests should now be working on Windows. The change of
 expand_path() to being a no-op *might* make the integ tests come a little
 closer to working. Stem's default test directory and logging path are unix
 specific which made that function give a hybrid path...

 F:\Dropbox\tor\stem\test/data/log

 but this should now be left as...

 ./data/log

 Windows understands unix path separators so I think that this is fine but
 guess we'll see...

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/5493#comment:11>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list