nose icon indicating copy to clipboard operation
nose copied to clipboard

--with-id and --processes=n don't play together

Open jpellerin opened this issue 13 years ago • 8 comments
trafficstars

What steps will reproduce the problem?

  1. use this simple 2-case file

$ cat > tests.py

def test1() assert True def test2(): assert True

  1. Run:

$ nosetests tests.py -verbose=2 --processes=2 --with-id

What is the expected output? What do you see instead?

Expected a success, instead I got:

ERROR ERROR

ERROR: tests.test1

Traceback (most recent call last): File "/Library/Python/2.6/site-packages/nose/case.py", line 133, in run self.runTest(result) File "/Library/Python/2.6/site-packages/nose/case.py", line 151, in runTest test(result) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 300, in call return self.run(_args, *_kwds) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 266, in run result.startTest(self) File "/Library/Python/2.6/site-packages/nose/proxy.py", line 161, in startTest self.plugins.startTest(self.test) File "/Library/Python/2.6/site-packages/nose/plugins/manager.py", line 94, in call return self.call(_arg, *_kw) File "/Library/Python/2.6/site-packages/nose/plugins/manager.py", line 162, in simple result = meth(_arg, *_kw) File "/Library/Python/2.6/site-packages/nose/plugins/testid.py", line 272, in startTest self.write('#%s ' % self.tests[adr]) File "/Library/Python/2.6/site-packages/nose/plugins/testid.py", line 306, in write self.stream.write(output) AttributeError: 'TestId' object has no attribute 'stream'

ERROR: tests.test2

Traceback (most recent call last): File "/Library/Python/2.6/site-packages/nose/case.py", line 133, in run self.runTest(result) File "/Library/Python/2.6/site-packages/nose/case.py", line 151, in runTest test(result) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 300, in call return self.run(_args, *_kwds) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/unittest.py", line 266, in run result.startTest(self) File "/Library/Python/2.6/site-packages/nose/proxy.py", line 161, in startTest self.plugins.startTest(self.test) File "/Library/Python/2.6/site-packages/nose/plugins/manager.py", line 94, in call return self.call(_arg, *_kw) File "/Library/Python/2.6/site-packages/nose/plugins/manager.py", line 162, in simple result = meth(_arg, *_kw) File "/Library/Python/2.6/site-packages/nose/plugins/testid.py", line 272, in startTest self.write('#%s ' % self.tests[adr]) File "/Library/Python/2.6/site-packages/nose/plugins/testid.py", line 306, in write self.stream.write(output) AttributeError: 'TestId' object has no attribute 'stream'


Ran 0 tests in 0.053s

FAILED (errors=2)

What version of the product are you using? On what operating system?

$ nosetests --version nosetests version 1.0.0

I'm on Mac OS X 10.6.8

Google Code Info: Issue #: 446 Author: [email protected] Created On: 2011-08-16T07:30:10.000Z Closed On:

jpellerin avatar Dec 14 '11 16:12 jpellerin

I'm getting this too; I'd love for this to be resolved since I'm not sure how to rerun our failed tests otherwise :-/

ysim avatar Jan 28 '13 18:01 ysim

I confirm this bug here too.

$ nosetests --version
nosetests version 1.3.4

bersace avatar Jan 27 '15 13:01 bersace

Yes, --verbose and --processes also fail like this for me with Nosetests 1.3.4.

georgevreilly avatar Feb 08 '15 23:02 georgevreilly

I can reproduce this even with nosetests 1.3.7. I'd appreciate any pointers for fixing it.

[rjanardhana@rj-desktop nose-test-debug]# nosetests --version
nosetests version 1.3.7
[rjanardhana@rj-desktop nose-test-debug]# cat tests.py
def test1():
    assert True
def test2():
    assert True
[rjanardhana@rj-desktop nose-test-debug]# nosetests tests.py -verbose=2 --processes=1 --with-id                                                                                 
ERROR
ERROR

======================================================================
ERROR: tests.test1
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 133, in run
    self.runTest(result)
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 151, in runTest
    test(result)
  File "/usr/lib/python2.7/unittest/case.py", line 395, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/case.py", line 306, in run
    result.startTest(self)
  File "/usr/local/lib/python2.7/dist-packages/nose/proxy.py", line 169, in startTest
    self.plugins.startTest(self.test)
  File "/usr/local/lib/python2.7/dist-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nose/plugins/testid.py", line 277, in startTest
    self.write('#%s ' % self.tests[adr])
  File "/usr/local/lib/python2.7/dist-packages/nose/plugins/testid.py", line 311, in write
    self.stream.write(output)
AttributeError: 'TestId' object has no attribute 'stream'

======================================================================
ERROR: tests.test2
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 133, in run
    self.runTest(result)
  File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 151, in runTest
    test(result)
  File "/usr/lib/python2.7/unittest/case.py", line 395, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/case.py", line 306, in run
    result.startTest(self)
  File "/usr/local/lib/python2.7/dist-packages/nose/proxy.py", line 169, in startTest
    self.plugins.startTest(self.test)
  File "/usr/local/lib/python2.7/dist-packages/nose/plugins/manager.py", line 99, in __call__
    return self.call(*arg, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nose/plugins/manager.py", line 167, in simple
    result = meth(*arg, **kw)
  File "/usr/local/lib/python2.7/dist-packages/nose/plugins/testid.py", line 277, in startTest
    self.write('#%s ' % self.tests[adr])
  File "/usr/local/lib/python2.7/dist-packages/nose/plugins/testid.py", line 311, in write
    self.stream.write(output)
AttributeError: 'TestId' object has no attribute 'stream'

----------------------------------------------------------------------
Ran 0 tests in 0.047s

FAILED (errors=2)

ravikiranj avatar Jan 20 '16 00:01 ravikiranj

I also have the same error while using --with-id and --with-yanc.

I am on the following OS: LSB Version: core-5.0-amd64:core-5.0-noarch Distributor ID: SUSE LINUX Description: openSUSE Leap 42.1 (x86_64) Release: 42.1

Using nose version 1.3.7 Using django-nose version 1.4.4 Using python 2.7.12 Using Django 1.7.11

Error Message: AttributeError: 'TestId' object has no attribute 'stream'

I thought this was fixed in the newest release of nose. Maybe it does not work with Django 1.7.

byteknacker avatar Aug 09 '16 09:08 byteknacker

same issue for me also --processes & --with-id are not happy together

nose: 1.3.7 or 1.3.4 tested on both
python: 2.7.11

p00j4 avatar Jan 17 '17 09:01 p00j4

same issue and below is the combination nosetests --failed --processes=25 --process-timeout=500 --process-restartworker --with-allure --logdir=/home/ubuntu/test --not-clear-logdir

nosetests version 1.3.7 python version 2.7.6

wondernath avatar Aug 07 '17 15:08 wondernath

Facing the same error nosetests --processes=2 --with-id

priyankasahani2229 avatar Aug 25 '22 07:08 priyankasahani2229