last day (14 days later) » 

1:34 PM
0
A: How to make nosetests use nosetests-2.7.exe

Vaibhav SagarAre you sure the issue is with the wrong nosetests binary? What happens if you try nose.run(argv="-w C:\MyProject -v -s".split()) and what error are you currently getting?

 
it runs , but it not recognize my tests , i made some experiments and what i found is if i use subprocess.call('c:\somePath\nosetests.exe -w C:\MyProject -v -s ') it doesnt recognize them , and if i use subprocess.call('c:\somePath\nosetests-2.7.exe -w C:\MyProject -v -s ') it works fine , i want the same result via programmatic way , i guess i should config somehow nosetests to use nosetests-2.7.exe
 
From this answer, what happens if you run nose.run(argv="-vv --collect-only".split())?
And what happens if you rename nosetests.exe to old_nosetests.exe and nosetests-2.7.exe to nosetests.exe and then try nose.run()?
 
still can't find the tests
i'll try to rename them now
well if i rename them it works , but i want a less hardcore solution :)
i renamed back , and restarted PyCharm and everything works now , very weird , tnx for your help
 
No worries, I was stuck because the relevant source code seemed to suggest that both nosetests.exe and nosetests-2.7.exe were pointing to the same function and I was considering opening an issue, but I'm glad it's decided to work now. Very strange though.
 
Dear @Vaibhav , i have another question for you :) how do i write the log to external file , tnx in advance
 
1:34 PM
You should be able to supply any of the command line arguments in argv. Documentation is here.
 
i read it 3 days already :) nothing about logging to file there
 
Hi Dima
which log are you talking about?
If it's the debug log, you can use the
--debug-log=FILE

Log debug messages to this file (default: sys.stderr)
option
otherwise you need to set up a logging configuration, load that and use the logcapture plugin
 
i want to write everything that appears in console screen to file
 
I believe you can redirect sys.stdout to a file
that sounds like it should do what you want
are you setting up automated tests?
that's what it sounds like to me
 
yep , i'm trying to set up nose for android automation
never done it before
so last week i learning about nose framework
 
1:41 PM
75
Q: Redirect stdout to a file in Python?

bvukelicHow do I redirect stdout to an arbitrary file in Python? EDIT at commenter's request: When a long-running Python script (e.g, web application) is started from within the ssh session and backgounded, and the ssh session is closed, the application will raise IOError and fail the moment it tries t...

Cool, I don't think I've ever used nose myself
 
do you know how to use LogCapture plugin ??
 
I've never used nose before :)
 
i think the "nose" guys should do better documentation
 
most open source projects are like this :)
have you considered using something like py.test?
I hear that's very good
and it seems a bit better documented
but for what you want, it should be enough to redirect stdout to a file
 
redirect is not good enough because i need to create a new logfile for every test
for just redirect i could use pipeline in cmd
python myScriptl > myFile.txt
 
1:48 PM
if you could have used a batch script, you wouldn't have needed to ask the question in the first place :)
you could create a file with the current date and time
if you need to capture all output, that might be a good way
or if you could grab the commit hash and use that...
 
i think the LogCapture should solve it , i need to investigate it a little bit
 
cool, all the best with that :)
 
thank you very much
for your help and time
 

last day (14 days later) »