File: test_helpers.py

package info (click to toggle)
python-testtools 2.7.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,400 kB
  • sloc: python: 14,643; makefile: 126; sh: 3
file content (30 lines) | stat: -rw-r--r-- 786 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Copyright (c) 2010-2012 testtools developers. See LICENSE for details.

from testtools import TestCase
from testtools.tests.helpers import (
    FullStackRunTest,
    hide_testtools_stack,
    is_stack_hidden,
)


class TestStackHiding(TestCase):
    run_tests_with = FullStackRunTest

    def setUp(self):
        super().setUp()
        self.addCleanup(hide_testtools_stack, is_stack_hidden())

    def test_is_stack_hidden_consistent_true(self):
        hide_testtools_stack(True)
        self.assertEqual(True, is_stack_hidden())

    def test_is_stack_hidden_consistent_false(self):
        hide_testtools_stack(False)
        self.assertEqual(False, is_stack_hidden())


def test_suite():
    from unittest import TestLoader

    return TestLoader().loadTestsFromName(__name__)