Cookiecutter generated projects log output three times during failed tests

Bug #1414347 reported by Kiall Mac Innes
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
oslotest
Expired
Low
Unassigned

Bug Description

Cookiecutter generated projects log output three times during failed tests, after generating a new project repo with cookiecutter, and changing the generated test_cctest.py file to:

**********************************************

from cctest.tests import base
import logging

LOG = logging.getLogger(__name__)

class TestCctest(base.TestCase):

    def test_something(self):
        LOG.critical('This should be logged exactly once')
        self.assertTrue(False)

**********************************************

Running the tests with `tox -epy27` will produce:

**********************************************

(cc)kiall@kiall-laptop:/tmp/cctest$ tox -e py27
py27 create: /tmp/cctest/.tox/py27
py27 installdeps: -r/tmp/cctest/requirements.txt, -r/tmp/cctest/test-requirements.txt
py27 develop-inst: /tmp/cctest
py27 runtests: commands[0] | python setup.py testr --slowest --testr-args=
running testr
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ . --list
running=OS_STDOUT_CAPTURE=${OS_STDOUT_CAPTURE:-1} \
OS_STDERR_CAPTURE=${OS_STDERR_CAPTURE:-1} \
OS_TEST_TIMEOUT=${OS_TEST_TIMEOUT:-60} \
${PYTHON:-python} -m subunit.run discover -t ./ . --load-list /tmp/tmpBhDIJ2
======================================================================
FAIL: cctest.tests.test_cctest.TestCctest.test_something
tags: worker-0
----------------------------------------------------------------------
stderr: {{{CRITICAL [cctest.tests.test_cctest] This should be logged exactly once}}}

Traceback (most recent call last):
  File "cctest/tests/test_cctest.py", line 32, in test_something
    self.assertTrue(False)
  File "/tmp/cctest/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 678, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true
Traceback (most recent call last):
_StringException: Empty attachments:
  stdout

stderr: {{{CRITICAL [cctest.tests.test_cctest] This should be logged exactly once}}}

Traceback (most recent call last):
  File "cctest/tests/test_cctest.py", line 32, in test_something
    self.assertTrue(False)
  File "/tmp/cctest/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 678, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true

Traceback (most recent call last):
_StringException: Empty attachments:
  stdout

stderr: {{{CRITICAL [cctest.tests.test_cctest] This should be logged exactly once}}}

Traceback (most recent call last):
  File "cctest/tests/test_cctest.py", line 32, in test_something
    self.assertTrue(False)
  File "/tmp/cctest/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 678, in assertTrue
    raise self.failureException(msg)
AssertionError: False is not true
Ran 1 tests in 0.002s
FAILED (id=0, failures=1)
error: testr failed (1)
ERROR: InvocationError: '/tmp/cctest/.tox/py27/bin/python setup.py testr --slowest --testr-args='
__________________________________________________________________________________________________ summary __________________________________________________________________________________________________
ERROR: py27: commands failed

**********************************************

Test file: http://paste.openstack.org/show/161444/ for better formatting
Output: http://paste.openstack.org/show/161445/ for better formatting

Changed in oslotest:
status: New → Confirmed
importance: Undecided → Low
Revision history for this message
Doug Hellmann (doug-hellmann) wrote :

I wonder if this is an oslotest problem, a testr problem, or an issue with our cookiecutter template.

Is it still happening?

Changed in oslotest:
status: Confirmed → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for oslotest because there has been no activity for 60 days.]

Changed in oslotest:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.