It's 11pm here, so excuse if this doesn't sound sane but what happens if
you amend your test_something.py to call nose internally (i.e. wrap it
in a if __name__ == '__main__' blob) and fire it off that way.

Also, dunno if it's of interest, but it works for me here on my setup,
but that's Maya 2013/x64/win (and therefore Python 2.6.4 as well..) and
I'm not able to run your command directly - it complains that nose is a
package and can't be directly executed so I'm invoking it directly by
doing -m nose.__main__ runme.py

Curiosity, what are you running it against on that side?

(Note again - 11pm. May not be making sense, apologies if i'm talking
rubbish. I've been playing with PHP and watching the Tour)

On Thu, Jul 23, 2015, at 10:44 PM, Marcus Ottosson wrote:
> 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?


>
> --
> *Marcus Ottosson* [email protected]
>


> --
>
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 [email protected].
>
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[1].
>
For more options, visit https://groups.google.com/d/optout.



Links:

  1. 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOC%2BuXTfKdoeYz%2BD%3D0Y3-uGvPDUuvtAR0ZEua-r7p8ELNw%40mail.gmail.com?utm_medium=email&utm_source=footer

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/1437657334.4158218.331201881.22C06651%40webmail.messagingengine.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to