I’m struggling with getting output from tests running through nose, after having initialised Maya.
This is what I get.
$ mayapy -m nose test_something.py
F
That is, nothing. This is the test.
test_something.py
import time
import maya.standalone
maya.standalone.initialize()
def test_something():
print "I'll be printed"
time.sleep(0.5)
assert False
When removing the call to maya.standalone.initialize(), I get what I’m expecting.
$ mayapy -m nose test_something.py
======================================================================
FAIL: test_something.test_something
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Program Files\Autodesk\Maya2015\Python\lib\site-packages\nose\case.py", line 19
7, in runTest
self.test(*self.arg)
File "c:\Users\marcus\test_something.py", line 7, in test_something
assert False
AssertionError:
-------------------- >> begin captured stdout << ---------------------
I'll be printed
--------------------- >> end captured stdout << ----------------------
It seems Maya is crippling stdout during initialisation, and I’ll need it back somehow.
Anyone have any ideas?
--You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC%2BuXTfKdoeYz%2BD%3D0Y3-uGvPDUuvtAR0ZEua-r7p8ELNw%40mail.gmail.com.For more options, visit https://groups.google.com/d/optout.
Thanks Tan, experimenting with this now..