# Path: stestr/tests/base.py
# class TestCase(testtools.TestCase):
#     def setUp(self):


import functools
import io
import os
import shutil
import subprocess
import tempfile
import subunit as subunit_lib
import testtools
import yaml
from stestr.tests import base
        self.assertIn('Sum of execute time for each test:', out)

    def test_subunit_trace_load_from_config_failing(self):
        fd, path = tempfile.mkstemp()
        self.addCleanup(os.remove, path)
        conf_file = os.fdopen(fd, 'wb', 0)
        self.addCleanup(conf_file.close)
        contents = str(
            yaml.dump({
                'run': {
                    'slowest': True,
                },
                'failing': {
                    'list': True
                },
                'last': {
                    'no-subunit-trace': True,
                },
                'load': {
                    'subunit-trace': True,
                }
            }, default_flow_style=False))
        conf_file.write(contents.encode('utf-8'))

        self.assertRunExit('stestr --user-config=%s run' % path, 1)
        stream = self._get_cmd_stdout(
            'stestr --user-config=%s last --subunit' % path)[0]
        out, err = self.assertRunExit('stestr --user-config=%s load' % path,
                                      0, stdin=stream)
        out = str(out)

# Path: stestr/tests/base.py
# class TestCase(testtools.TestCase):
#     def setUp(self):


# Path: stestr/tests/test_user_config_return_codes.py
import functools
import io
import os
import shutil
import subprocess
import tempfile
import subunit as subunit_lib
import testtools
import yaml
from stestr.tests import base

        self.assertIn('Sum of execute time for each test:', out)

    def test_subunit_trace_load_from_config_failing(self):
        fd, path = tempfile.mkstemp()
        self.addCleanup(os.remove, path)
        conf_file = os.fdopen(fd, 'wb', 0)
        self.addCleanup(conf_file.close)
        contents = str(
            yaml.dump({
                'run': {
                    'slowest': True,
                },
                'failing': {
                    'list': True
                },
                'last': {
                    'no-subunit-trace': True,
                },
                'load': {
                    'subunit-trace': True,
                }
            }, default_flow_style=False))
        conf_file.write(contents.encode('utf-8'))

        self.assertRunExit('stestr --user-config=%s run' % path, 1)
        stream = self._get_cmd_stdout(
            'stestr --user-config=%s last --subunit' % path)[0]
        out, err = self.assertRunExit('stestr --user-config=%s load' % path,
                                      0, stdin=stream)
        out = str(out)

        self.assertNotIn('FAILED (id=0, failures=2)', out)