From c19232a9d2be2bde30e446311f32e9dcdd5d4774 Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Sat, 2 Feb 2013 11:15:11 -0500 Subject: Move the test directory to tests to avoid conflicts with the stdlib test package. --HG-- rename : test/__init__.py => tests/__init__.py rename : test/backtest.py => tests/backtest.py rename : test/backunittest.py => tests/backunittest.py rename : test/coveragetest.py => tests/coveragetest.py rename : test/covmodzip1.py => tests/covmodzip1.py rename : test/eggsrc/egg1/__init__.py => tests/eggsrc/egg1/__init__.py rename : test/eggsrc/egg1/egg1.py => tests/eggsrc/egg1/egg1.py rename : test/eggsrc/setup.py => tests/eggsrc/setup.py rename : test/farm/annotate/annotate_dir.py => tests/farm/annotate/annotate_dir.py rename : test/farm/annotate/gold/white.py,cover => tests/farm/annotate/gold/white.py,cover rename : test/farm/annotate/gold_anno_dir/a___init__.py,cover => tests/farm/annotate/gold_anno_dir/a___init__.py,cover rename : test/farm/annotate/gold_anno_dir/a_a.py,cover => tests/farm/annotate/gold_anno_dir/a_a.py,cover rename : test/farm/annotate/gold_anno_dir/b___init__.py,cover => tests/farm/annotate/gold_anno_dir/b___init__.py,cover rename : test/farm/annotate/gold_anno_dir/b_b.py,cover => tests/farm/annotate/gold_anno_dir/b_b.py,cover rename : test/farm/annotate/gold_anno_dir/multi.py,cover => tests/farm/annotate/gold_anno_dir/multi.py,cover rename : test/farm/annotate/gold_multi/a/__init__.py,cover => tests/farm/annotate/gold_multi/a/__init__.py,cover rename : test/farm/annotate/gold_multi/a/a.py,cover => tests/farm/annotate/gold_multi/a/a.py,cover rename : test/farm/annotate/gold_multi/b/__init__.py,cover => tests/farm/annotate/gold_multi/b/__init__.py,cover rename : test/farm/annotate/gold_multi/b/b.py,cover => tests/farm/annotate/gold_multi/b/b.py,cover rename : test/farm/annotate/gold_multi/multi.py,cover => tests/farm/annotate/gold_multi/multi.py,cover rename : test/farm/annotate/gold_v24/white.py,cover => tests/farm/annotate/gold_v24/white.py,cover rename : test/farm/annotate/run.py => tests/farm/annotate/run.py rename : test/farm/annotate/run_multi.py => tests/farm/annotate/run_multi.py rename : test/farm/annotate/src/a/__init__.py => tests/farm/annotate/src/a/__init__.py rename : test/farm/annotate/src/a/a.py => tests/farm/annotate/src/a/a.py rename : test/farm/annotate/src/b/__init__.py => tests/farm/annotate/src/b/__init__.py rename : test/farm/annotate/src/b/b.py => tests/farm/annotate/src/b/b.py rename : test/farm/annotate/src/multi.py => tests/farm/annotate/src/multi.py rename : test/farm/annotate/src/white.py => tests/farm/annotate/src/white.py rename : test/farm/html/gold_a/a.html => tests/farm/html/gold_a/a.html rename : test/farm/html/gold_a/index.html => tests/farm/html/gold_a/index.html rename : test/farm/html/gold_b_branch/b.html => tests/farm/html/gold_b_branch/b.html rename : test/farm/html/gold_b_branch/index.html => tests/farm/html/gold_b_branch/index.html rename : test/farm/html/gold_bom/bom.html => tests/farm/html/gold_bom/bom.html rename : test/farm/html/gold_bom/index.html => tests/farm/html/gold_bom/index.html rename : test/farm/html/gold_isolatin1/index.html => tests/farm/html/gold_isolatin1/index.html rename : test/farm/html/gold_isolatin1/isolatin1.html => tests/farm/html/gold_isolatin1/isolatin1.html rename : test/farm/html/gold_omit_1/index.html => tests/farm/html/gold_omit_1/index.html rename : test/farm/html/gold_omit_1/m1.html => tests/farm/html/gold_omit_1/m1.html rename : test/farm/html/gold_omit_1/m2.html => tests/farm/html/gold_omit_1/m2.html rename : test/farm/html/gold_omit_1/m3.html => tests/farm/html/gold_omit_1/m3.html rename : test/farm/html/gold_omit_1/main.html => tests/farm/html/gold_omit_1/main.html rename : test/farm/html/gold_omit_2/index.html => tests/farm/html/gold_omit_2/index.html rename : test/farm/html/gold_omit_2/m2.html => tests/farm/html/gold_omit_2/m2.html rename : test/farm/html/gold_omit_2/m3.html => tests/farm/html/gold_omit_2/m3.html rename : test/farm/html/gold_omit_2/main.html => tests/farm/html/gold_omit_2/main.html rename : test/farm/html/gold_omit_3/index.html => tests/farm/html/gold_omit_3/index.html rename : test/farm/html/gold_omit_3/m3.html => tests/farm/html/gold_omit_3/m3.html rename : test/farm/html/gold_omit_3/main.html => tests/farm/html/gold_omit_3/main.html rename : test/farm/html/gold_omit_4/index.html => tests/farm/html/gold_omit_4/index.html rename : test/farm/html/gold_omit_4/m1.html => tests/farm/html/gold_omit_4/m1.html rename : test/farm/html/gold_omit_4/m3.html => tests/farm/html/gold_omit_4/m3.html rename : test/farm/html/gold_omit_4/main.html => tests/farm/html/gold_omit_4/main.html rename : test/farm/html/gold_omit_5/index.html => tests/farm/html/gold_omit_5/index.html rename : test/farm/html/gold_omit_5/m1.html => tests/farm/html/gold_omit_5/m1.html rename : test/farm/html/gold_omit_5/main.html => tests/farm/html/gold_omit_5/main.html rename : test/farm/html/gold_other/blah_blah_other.html => tests/farm/html/gold_other/blah_blah_other.html rename : test/farm/html/gold_other/here.html => tests/farm/html/gold_other/here.html rename : test/farm/html/gold_other/index.html => tests/farm/html/gold_other/index.html rename : test/farm/html/gold_partial/index.html => tests/farm/html/gold_partial/index.html rename : test/farm/html/gold_partial/partial.html => tests/farm/html/gold_partial/partial.html rename : test/farm/html/gold_styled/a.html => tests/farm/html/gold_styled/a.html rename : test/farm/html/gold_styled/extra.css => tests/farm/html/gold_styled/extra.css rename : test/farm/html/gold_styled/index.html => tests/farm/html/gold_styled/index.html rename : test/farm/html/gold_styled/style.css => tests/farm/html/gold_styled/style.css rename : test/farm/html/gold_unicode/index.html => tests/farm/html/gold_unicode/index.html rename : test/farm/html/gold_unicode/unicode.html => tests/farm/html/gold_unicode/unicode.html rename : test/farm/html/gold_x_xml/coverage.xml => tests/farm/html/gold_x_xml/coverage.xml rename : test/farm/html/gold_y_xml_branch/coverage.xml => tests/farm/html/gold_y_xml_branch/coverage.xml rename : test/farm/html/othersrc/other.py => tests/farm/html/othersrc/other.py rename : test/farm/html/run_a.py => tests/farm/html/run_a.py rename : test/farm/html/run_a_xml_1.py => tests/farm/html/run_a_xml_1.py rename : test/farm/html/run_a_xml_2.py => tests/farm/html/run_a_xml_2.py rename : test/farm/html/run_b_branch.py => tests/farm/html/run_b_branch.py rename : test/farm/html/run_bom.py => tests/farm/html/run_bom.py rename : test/farm/html/run_isolatin1.py => tests/farm/html/run_isolatin1.py rename : test/farm/html/run_omit_1.py => tests/farm/html/run_omit_1.py rename : test/farm/html/run_omit_2.py => tests/farm/html/run_omit_2.py rename : test/farm/html/run_omit_3.py => tests/farm/html/run_omit_3.py rename : test/farm/html/run_omit_4.py => tests/farm/html/run_omit_4.py rename : test/farm/html/run_omit_5.py => tests/farm/html/run_omit_5.py rename : test/farm/html/run_other.py => tests/farm/html/run_other.py rename : test/farm/html/run_partial.py => tests/farm/html/run_partial.py rename : test/farm/html/run_styled.py => tests/farm/html/run_styled.py rename : test/farm/html/run_tabbed.py => tests/farm/html/run_tabbed.py rename : test/farm/html/run_unicode.py => tests/farm/html/run_unicode.py rename : test/farm/html/run_y_xml_branch.py => tests/farm/html/run_y_xml_branch.py rename : test/farm/html/src/a.py => tests/farm/html/src/a.py rename : test/farm/html/src/b.py => tests/farm/html/src/b.py rename : test/farm/html/src/bom.py => tests/farm/html/src/bom.py rename : test/farm/html/src/coverage.xml => tests/farm/html/src/coverage.xml rename : test/farm/html/src/extra.css => tests/farm/html/src/extra.css rename : test/farm/html/src/here.py => tests/farm/html/src/here.py rename : test/farm/html/src/isolatin1.py => tests/farm/html/src/isolatin1.py rename : test/farm/html/src/m1.py => tests/farm/html/src/m1.py rename : test/farm/html/src/m2.py => tests/farm/html/src/m2.py rename : test/farm/html/src/m3.py => tests/farm/html/src/m3.py rename : test/farm/html/src/main.py => tests/farm/html/src/main.py rename : test/farm/html/src/omit4.ini => tests/farm/html/src/omit4.ini rename : test/farm/html/src/omit5.ini => tests/farm/html/src/omit5.ini rename : test/farm/html/src/partial.py => tests/farm/html/src/partial.py rename : test/farm/html/src/run_a_xml_2.ini => tests/farm/html/src/run_a_xml_2.ini rename : test/farm/html/src/tabbed.py => tests/farm/html/src/tabbed.py rename : test/farm/html/src/unicode.py => tests/farm/html/src/unicode.py rename : test/farm/html/src/y.py => tests/farm/html/src/y.py rename : test/farm/run/run_chdir.py => tests/farm/run/run_chdir.py rename : test/farm/run/run_timid.py => tests/farm/run/run_timid.py rename : test/farm/run/run_xxx.py => tests/farm/run/run_xxx.py rename : test/farm/run/src/chdir.py => tests/farm/run/src/chdir.py rename : test/farm/run/src/showtrace.py => tests/farm/run/src/showtrace.py rename : test/farm/run/src/subdir/placeholder => tests/farm/run/src/subdir/placeholder rename : test/farm/run/src/xxx => tests/farm/run/src/xxx rename : test/js/index.html => tests/js/index.html rename : test/js/tests.js => tests/js/tests.js rename : test/modules/aa/__init__.py => tests/modules/aa/__init__.py rename : test/modules/aa/afile.odd.py => tests/modules/aa/afile.odd.py rename : test/modules/aa/afile.py => tests/modules/aa/afile.py rename : test/modules/aa/bb.odd/bfile.py => tests/modules/aa/bb.odd/bfile.py rename : test/modules/aa/bb/__init__.py => tests/modules/aa/bb/__init__.py rename : test/modules/aa/bb/bfile.odd.py => tests/modules/aa/bb/bfile.odd.py rename : test/modules/aa/bb/bfile.py => tests/modules/aa/bb/bfile.py rename : test/modules/aa/bb/cc/__init__.py => tests/modules/aa/bb/cc/__init__.py rename : test/modules/aa/bb/cc/cfile.py => tests/modules/aa/bb/cc/cfile.py rename : test/modules/aa/zfile.py => tests/modules/aa/zfile.py rename : test/modules/covmod1.py => tests/modules/covmod1.py rename : test/modules/pkg1/__init__.py => tests/modules/pkg1/__init__.py rename : test/modules/pkg1/__main__.py => tests/modules/pkg1/__main__.py rename : test/modules/pkg1/p1a.py => tests/modules/pkg1/p1a.py rename : test/modules/pkg1/p1b.py => tests/modules/pkg1/p1b.py rename : test/modules/pkg1/p1c.py => tests/modules/pkg1/p1c.py rename : test/modules/pkg1/runmod2.py => tests/modules/pkg1/runmod2.py rename : test/modules/pkg1/sub/__init__.py => tests/modules/pkg1/sub/__init__.py rename : test/modules/pkg1/sub/__main__.py => tests/modules/pkg1/sub/__main__.py rename : test/modules/pkg1/sub/ps1a.py => tests/modules/pkg1/sub/ps1a.py rename : test/modules/pkg1/sub/runmod3.py => tests/modules/pkg1/sub/runmod3.py rename : test/modules/pkg2/__init__.py => tests/modules/pkg2/__init__.py rename : test/modules/pkg2/p2a.py => tests/modules/pkg2/p2a.py rename : test/modules/pkg2/p2b.py => tests/modules/pkg2/p2b.py rename : test/modules/runmod1.py => tests/modules/runmod1.py rename : test/modules/usepkgs.py => tests/modules/usepkgs.py rename : test/moremodules/othermods/__init__.py => tests/moremodules/othermods/__init__.py rename : test/moremodules/othermods/othera.py => tests/moremodules/othermods/othera.py rename : test/moremodules/othermods/otherb.py => tests/moremodules/othermods/otherb.py rename : test/moremodules/othermods/sub/__init__.py => tests/moremodules/othermods/sub/__init__.py rename : test/moremodules/othermods/sub/osa.py => tests/moremodules/othermods/sub/osa.py rename : test/moremodules/othermods/sub/osb.py => tests/moremodules/othermods/sub/osb.py rename : test/osinfo.py => tests/osinfo.py rename : test/qunit/jquery.tmpl.min.js => tests/qunit/jquery.tmpl.min.js rename : test/qunit/qunit.css => tests/qunit/qunit.css rename : test/qunit/qunit.js => tests/qunit/qunit.js rename : test/stress_phystoken.tok => tests/stress_phystoken.tok rename : test/stress_phystoken_dos.tok => tests/stress_phystoken_dos.tok rename : test/test_api.py => tests/test_api.py rename : test/test_arcs.py => tests/test_arcs.py rename : test/test_cmdline.py => tests/test_cmdline.py rename : test/test_codeunit.py => tests/test_codeunit.py rename : test/test_config.py => tests/test_config.py rename : test/test_coverage.py => tests/test_coverage.py rename : test/test_data.py => tests/test_data.py rename : test/test_execfile.py => tests/test_execfile.py rename : test/test_farm.py => tests/test_farm.py rename : test/test_files.py => tests/test_files.py rename : test/test_html.py => tests/test_html.py rename : test/test_misc.py => tests/test_misc.py rename : test/test_oddball.py => tests/test_oddball.py rename : test/test_parser.py => tests/test_parser.py rename : test/test_phystokens.py => tests/test_phystokens.py rename : test/test_process.py => tests/test_process.py rename : test/test_results.py => tests/test_results.py rename : test/test_summary.py => tests/test_summary.py rename : test/test_templite.py => tests/test_templite.py rename : test/test_testing.py => tests/test_testing.py rename : test/test_xml.py => tests/test_xml.py rename : test/try_execfile.py => tests/try_execfile.py --- tests/farm/html/src/a.py | 7 +++++++ tests/farm/html/src/b.py | 29 +++++++++++++++++++++++++++++ tests/farm/html/src/bom.py | 11 +++++++++++ tests/farm/html/src/coverage.xml | 20 ++++++++++++++++++++ tests/farm/html/src/extra.css | 1 + tests/farm/html/src/here.py | 8 ++++++++ tests/farm/html/src/isolatin1.py | 5 +++++ tests/farm/html/src/m1.py | 2 ++ tests/farm/html/src/m2.py | 2 ++ tests/farm/html/src/m3.py | 2 ++ tests/farm/html/src/main.py | 10 ++++++++++ tests/farm/html/src/omit4.ini | 2 ++ tests/farm/html/src/omit5.ini | 8 ++++++++ tests/farm/html/src/partial.py | 18 ++++++++++++++++++ tests/farm/html/src/run_a_xml_2.ini | 3 +++ tests/farm/html/src/tabbed.py | 7 +++++++ tests/farm/html/src/unicode.py | 5 +++++ tests/farm/html/src/y.py | 9 +++++++++ 18 files changed, 149 insertions(+) create mode 100644 tests/farm/html/src/a.py create mode 100644 tests/farm/html/src/b.py create mode 100644 tests/farm/html/src/bom.py create mode 100644 tests/farm/html/src/coverage.xml create mode 100644 tests/farm/html/src/extra.css create mode 100644 tests/farm/html/src/here.py create mode 100644 tests/farm/html/src/isolatin1.py create mode 100644 tests/farm/html/src/m1.py create mode 100644 tests/farm/html/src/m2.py create mode 100644 tests/farm/html/src/m3.py create mode 100644 tests/farm/html/src/main.py create mode 100644 tests/farm/html/src/omit4.ini create mode 100644 tests/farm/html/src/omit5.ini create mode 100644 tests/farm/html/src/partial.py create mode 100644 tests/farm/html/src/run_a_xml_2.ini create mode 100644 tests/farm/html/src/tabbed.py create mode 100644 tests/farm/html/src/unicode.py create mode 100644 tests/farm/html/src/y.py (limited to 'tests/farm/html/src') diff --git a/tests/farm/html/src/a.py b/tests/farm/html/src/a.py new file mode 100644 index 00000000..9e71aebd --- /dev/null +++ b/tests/farm/html/src/a.py @@ -0,0 +1,7 @@ +# A test file for HTML reporting by coverage. + +if 1 < 2: + # Needed a < to look at HTML entities. + a = 3 +else: + a = 4 diff --git a/tests/farm/html/src/b.py b/tests/farm/html/src/b.py new file mode 100644 index 00000000..3bf73a9f --- /dev/null +++ b/tests/farm/html/src/b.py @@ -0,0 +1,29 @@ +# A test file for HTML reporting by coverage. + +def one(x): + # This will be a branch that misses the else. + if x < 2: + a = 3 + else: + a = 4 + +one(1) + +def two(x): + # A missed else that branches to "exit" + if x: + a = 5 + +two(1) + +def three(): + try: + # This if has two branches, *neither* one taken. + if name_error_this_variable_doesnt_exist: + a = 1 + else: + a = 2 + except: + pass + +three() diff --git a/tests/farm/html/src/bom.py b/tests/farm/html/src/bom.py new file mode 100644 index 00000000..2db8b717 --- /dev/null +++ b/tests/farm/html/src/bom.py @@ -0,0 +1,11 @@ +# A python source file in utf-8, with BOM +math = "3×4 = 12, ÷2 = 6±0" + +import sys + +if sys.version_info >= (3, 0): + assert len(math) == 18 + assert len(math.encode('utf-8')) == 21 +else: + assert len(math) == 21 + assert len(math.decode('utf-8')) == 18 diff --git a/tests/farm/html/src/coverage.xml b/tests/farm/html/src/coverage.xml new file mode 100644 index 00000000..128cf750 --- /dev/null +++ b/tests/farm/html/src/coverage.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + diff --git a/tests/farm/html/src/extra.css b/tests/farm/html/src/extra.css new file mode 100644 index 00000000..46c41fcd --- /dev/null +++ b/tests/farm/html/src/extra.css @@ -0,0 +1 @@ +/* Doesn't matter what goes in here, it gets copied. */ diff --git a/tests/farm/html/src/here.py b/tests/farm/html/src/here.py new file mode 100644 index 00000000..d0d26ea7 --- /dev/null +++ b/tests/farm/html/src/here.py @@ -0,0 +1,8 @@ +# A test file for HTML reporting by coverage. + +import other + +if 1 < 2: + h = 3 +else: + h = 4 diff --git a/tests/farm/html/src/isolatin1.py b/tests/farm/html/src/isolatin1.py new file mode 100644 index 00000000..057c097b --- /dev/null +++ b/tests/farm/html/src/isolatin1.py @@ -0,0 +1,5 @@ +# A python source file in another encoding. +# -*- coding: iso8859-1 -*- + +math = "34 = 12, 2 = 60" +assert len(math) == 18 diff --git a/tests/farm/html/src/m1.py b/tests/farm/html/src/m1.py new file mode 100644 index 00000000..927e1f6b --- /dev/null +++ b/tests/farm/html/src/m1.py @@ -0,0 +1,2 @@ +m1a = 1 +m1b = 2 diff --git a/tests/farm/html/src/m2.py b/tests/farm/html/src/m2.py new file mode 100644 index 00000000..ffddf6cf --- /dev/null +++ b/tests/farm/html/src/m2.py @@ -0,0 +1,2 @@ +m2a = 1 +m2b = 2 diff --git a/tests/farm/html/src/m3.py b/tests/farm/html/src/m3.py new file mode 100644 index 00000000..395d7d25 --- /dev/null +++ b/tests/farm/html/src/m3.py @@ -0,0 +1,2 @@ +m3a = 1 +m3b = 2 diff --git a/tests/farm/html/src/main.py b/tests/farm/html/src/main.py new file mode 100644 index 00000000..ce894465 --- /dev/null +++ b/tests/farm/html/src/main.py @@ -0,0 +1,10 @@ +import m1 +import m2 +import m3 + +a = 5 +b = 6 + +assert m1.m1a == 1 +assert m2.m2a == 1 +assert m3.m3a == 1 diff --git a/tests/farm/html/src/omit4.ini b/tests/farm/html/src/omit4.ini new file mode 100644 index 00000000..6821ecda --- /dev/null +++ b/tests/farm/html/src/omit4.ini @@ -0,0 +1,2 @@ +[report] +omit = m2.py diff --git a/tests/farm/html/src/omit5.ini b/tests/farm/html/src/omit5.ini new file mode 100644 index 00000000..7e32b414 --- /dev/null +++ b/tests/farm/html/src/omit5.ini @@ -0,0 +1,8 @@ +[report] +omit = + fooey + gooey, m[23]*, kablooey + helloworld + +[html] +directory = ../html_omit_5 diff --git a/tests/farm/html/src/partial.py b/tests/farm/html/src/partial.py new file mode 100644 index 00000000..8d62f5c5 --- /dev/null +++ b/tests/farm/html/src/partial.py @@ -0,0 +1,18 @@ +# partial branches + +a = 3 + +while True: + break + +while 1: + break + +while a: # pragma: no branch + break + +if 0: + never_happen() + +if 1: + a = 13 diff --git a/tests/farm/html/src/run_a_xml_2.ini b/tests/farm/html/src/run_a_xml_2.ini new file mode 100644 index 00000000..8d28f97b --- /dev/null +++ b/tests/farm/html/src/run_a_xml_2.ini @@ -0,0 +1,3 @@ +# Put all the XML output in xml_2 +[xml] +output = ../xml_2/coverage.xml diff --git a/tests/farm/html/src/tabbed.py b/tests/farm/html/src/tabbed.py new file mode 100644 index 00000000..2035852f --- /dev/null +++ b/tests/farm/html/src/tabbed.py @@ -0,0 +1,7 @@ +# This file should have tabs. +x = 1 +if x: + a = "Tabbed" # Aligned comments + if x: # look nice + b = "No spaces" # when they + c = "Done" # line up. diff --git a/tests/farm/html/src/unicode.py b/tests/farm/html/src/unicode.py new file mode 100644 index 00000000..f6a9a052 --- /dev/null +++ b/tests/farm/html/src/unicode.py @@ -0,0 +1,5 @@ +# A python source file with exotic characters +# -*- coding: utf-8 -*- + +upside_down = "ʎd˙ǝbɐɹǝʌoɔ" +surrogate = "db40,dd00: x󠄀" diff --git a/tests/farm/html/src/y.py b/tests/farm/html/src/y.py new file mode 100644 index 00000000..af7c9689 --- /dev/null +++ b/tests/farm/html/src/y.py @@ -0,0 +1,9 @@ +# A test file for XML reporting by coverage. + +def choice(x): + if x < 2: + return 3 + else: + return 4 + +assert choice(1) == 3 -- cgit v1.2.1