Debian Codegraph @

python/tests/__init__.py

raw
1 #
2 # subunit: extensions to python unittest to get test results from subprocesses.
3 # Copyright (C) 2005 Robert Collins <[email protected]>
4 #
5 # Licensed under either the Apache License, Version 2.0 or the BSD 3-clause
6 # license at the users choice. A copy of both licenses are available in the
7 # project source as Apache-2.0 and BSD. You may not use this file except in
8 # compliance with one of these two licences.
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under these licenses is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # license you chose for the specific language governing permissions and
14 # limitations under that license.
15 #
16
17 from unittest import TestLoader
18
19 from testscenarios import generate_scenarios
20
21 # Before the test module imports to avoid circularity.
22 # For testing: different pythons have different str() implementations.
23 _remote_exception_repr = "testtools.testresult.real._StringException"
24 _remote_exception_repr_chunked = "34\r\n" + _remote_exception_repr + ": boo qux\n0\r\n"
25 _remote_exception_str = "Traceback (most recent call last):\ntesttools.testresult.real._StringException"
26 _remote_exception_str_chunked = "57\r\n" + _remote_exception_str + ": boo qux\n0\r\n"
27
28
29 from . import ( # noqa: E402
30 test_chunked,
31 test_details,
32 test_filter_to_disk,
33 test_filters,
34 test_output_filter,
35 test_progress_model,
36 test_run,
37 test_subunit_filter,
38 test_subunit_stats,
39 test_subunit_tags,
40 test_tap2subunit,
41 test_test_protocol,
42 test_test_protocol2,
43 test_test_results,
44 )
45
46
47 def test_suite():
48 loader = TestLoader()
49 result = loader.loadTestsFromModule(test_chunked)
50 result.addTest(loader.loadTestsFromModule(test_details))
51 result.addTest(loader.loadTestsFromModule(test_filters))
52 result.addTest(loader.loadTestsFromModule(test_progress_model))
53 result.addTest(loader.loadTestsFromModule(test_test_results))
54 result.addTest(loader.loadTestsFromModule(test_test_protocol))
55 result.addTest(loader.loadTestsFromModule(test_test_protocol2))
56 result.addTest(loader.loadTestsFromModule(test_tap2subunit))
57 result.addTest(loader.loadTestsFromModule(test_filter_to_disk))
58 result.addTest(loader.loadTestsFromModule(test_subunit_filter))
59 result.addTest(loader.loadTestsFromModule(test_subunit_tags))
60 result.addTest(loader.loadTestsFromModule(test_subunit_stats))
61 result.addTest(loader.loadTestsFromModule(test_run))
62 result.addTests(generate_scenarios(loader.loadTestsFromModule(test_output_filter)))
63 return result