Commits

Ned Batchelder committed 9c447e8

Directory changed: test->tests. Adapt.

  • Participants
  • Parent commits 1f52409

Comments (0)

Files changed (30)

 include igor.py
 include tox.ini
 
-recursive-include test *
+recursive-include tests *
 recursive-include doc *.rst
 global-exclude *.pyc
 default:
 	@echo "* No default action *"
 
-TEST_ZIP = test/zipmods.zip
-TEST_EGG = test/eggsrc/dist/covtestegg1-0.0.0-py*.egg
+TEST_ZIP = tests/zipmods.zip
+TEST_EGG = tests/eggsrc/dist/covtestegg1-0.0.0-py*.egg
 
 clean:
 	-rm -f *.pyd */*.pyd
 	-rm -f *.so */*.so
-	PYTHONPATH=. python test/test_farm.py clean
+	PYTHONPATH=. python tests/test_farm.py clean
 	-rm -rf build coverage.egg-info dist htmlcov
 	-rm -f *.pyc */*.pyc */*/*.pyc */*/*/*.pyc */*/*/*/*.pyc */*/*/*/*/*.pyc
 	-rm -f *.pyo */*.pyo */*/*.pyo */*/*/*.pyo */*/*/*/*.pyo */*/*/*/*/*.pyo
 	-rm -f MANIFEST
 	-rm -f .coverage .coverage.* coverage.xml
 	-rm -f $(TEST_ZIP)
-	-rm -rf test/eggsrc/build test/eggsrc/dist test/eggsrc/*.egg-info
+	-rm -rf tests/eggsrc/build tests/eggsrc/dist tests/eggsrc/*.egg-info
 	-rm -f setuptools-*.egg distribute-*.egg distribute-*.tar.gz
 	-rm -rf doc/_build
 
 sterile: clean
 	-rm -rf .tox*
 
-LINTABLE = coverage igor.py setup.py test
+LINTABLE = coverage igor.py setup.py tests
 
 lint:
 	-pylint --rcfile=.pylintrc $(LINTABLE)
 pep8:
 	pep8 --filename=*.py --ignore=E401,E301 --repeat coverage
 
-tests:
+test:
 	tox -e py27 $(ARGS)
 
 metacov:

File doc/contributing.rst

 
 To run just a few tests, you can use nose test selector syntax::
 
-    $ tox test.test_misc:SetupPyTest.test_metadata
+    $ tox tests.test_misc:SetupPyTest.test_metadata
 
-This looks in `test/test_misc.py` to find the `SetupPyTest` class, and runs the
+This looks in `tests/test_misc.py` to find the `SetupPyTest` class, and runs the
 `test_metadata` test method.
 
 Of course, run all the tests on every version of Python you have, before
 to possible problems::
 
     $ make lint
-    pylint --rcfile=.pylintrc coverage setup.py test
-    python -m tabnanny coverage setup.py test
+    pylint --rcfile=.pylintrc coverage setup.py tests
+    python -m tabnanny coverage setup.py tests
     python igor.py check_eol
 
 The source is pylint-clean, even if it's because there are pragmas quieting
 
 - To run the Javascript tests:
 
-    open test/js/index.html in variety of browsers.
+    open tests/js/index.html in variety of browsers.
 
 def do_zip_mods():
     """Build the zipmods.zip file."""
-    zf = zipfile.ZipFile("test/zipmods.zip", "w")
-    zf.write("test/covmodzip1.py", "covmodzip1.py")
+    zf = zipfile.ZipFile("tests/zipmods.zip", "w")
+    zf.write("tests/covmodzip1.py", "covmodzip1.py")
     zf.close()
 
 def do_install_egg():
     # pylint: disable=F0401,E0611,E1101
     import distutils.core
     cur_dir = os.getcwd()
-    os.chdir("test/eggsrc")
+    os.chdir("tests/eggsrc")
     distutils.core.run_setup("setup.py", ["--quiet", "bdist_egg"])
     egg = glob.glob("dist/*.egg")[0]
     distutils.core.run_setup(
 
     check_files("coverage", ["*.py", "*.c"])
     check_files("coverage/htmlfiles", ["*.html", "*.css", "*.js"])
-    check_file("test/farm/html/src/bom.py", crlf=False)
-    check_files("test", ["*.py"])
-    check_files("test", ["*,cover"], trail_white=False)
-    check_files("test/js", ["*.js", "*.html"])
+    check_file("tests/farm/html/src/bom.py", crlf=False)
+    check_files("tests", ["*.py"])
+    check_files("tests", ["*,cover"], trail_white=False)
+    check_files("tests/js", ["*.js", "*.html"])
     check_file("setup.py")
     check_file("igor.py")
     check_file("Makefile")
 parallel = true
 source =
     $COVERAGE_HOME/coverage
-    $COVERAGE_HOME/test
+    $COVERAGE_HOME/tests
     $COVERAGE_HOME/.tox/py25/lib/python2.5/site-packages/coverage
     $COVERAGE_HOME/.tox/py26/lib/python2.6/site-packages/coverage
     $COVERAGE_HOME/.tox/py27/lib/python2.7/site-packages/coverage

File tests/coveragetest.py

 from coverage.backward import sorted, StringIO      # pylint: disable=W0622
 from coverage.backward import to_bytes
 from coverage.control import _TEST_NAME_FILE
-from test.backtest import run_command
-from test.backunittest import TestCase
+from tests.backtest import run_command
+from tests.backunittest import TestCase
 
 class Tee(object):
     """A file-like that writes to all the file-likes it has."""
         # Add our test modules directory to PYTHONPATH.  I'm sure there's too
         # much path munging here, but...
         here = os.path.dirname(self.nice_file(coverage.__file__, ".."))
-        testmods = self.nice_file(here, 'test/modules')
-        zipfile = self.nice_file(here, 'test/zipmods.zip')
+        testmods = self.nice_file(here, 'tests/modules')
+        zipfile = self.nice_file(here, 'tests/zipmods.zip')
         pypath = os.getenv('PYTHONPATH', '')
         if pypath:
             pypath += os.pathsep

File tests/farm/html/gold_other/blah_blah_other.html

     
     
     <meta http-equiv='X-UA-Compatible' content='IE=emulateIE7' />
-    <title>Coverage for /home/ned/coverage/trunk/test/farm/html/othersrc/other: 100%</title>
+    <title>Coverage for /home/ned/coverage/trunk/tests/farm/html/othersrc/other: 100%</title>
     <link rel='stylesheet' href='style.css' type='text/css'>
     <script type='text/javascript' src='jquery-1.4.3.min.js'></script>
     <script type='text/javascript' src='jquery.hotkeys.js'></script>
 
 <div id='header'>
     <div class='content'>
-        <h1>Coverage for <b>/home/ned/coverage/trunk/test/farm/html/othersrc/other</b> :
+        <h1>Coverage for <b>/home/ned/coverage/trunk/tests/farm/html/othersrc/other</b> :
             <span class='pc_cov'>100%</span>
         </h1>
         <img id='keyboard_icon' src='keybd_closed.png'>

File tests/farm/html/gold_other/index.html

         <tbody>
             
             <tr class='file'>
-                <td class='name left'><a href='_home_ned_coverage_trunk_test_farm_html_othersrc_other.html'>/home/ned/coverage/trunk/test/farm/html/othersrc/other</a></td>
+                <td class='name left'><a href='_home_ned_coverage_trunk_tests_farm_html_othersrc_other.html'>/home/ned/coverage/trunk/tests/farm/html/othersrc/other</a></td>
                 <td>1</td>
                 <td>0</td>
                 <td>0</td>

File tests/test_api.py

 import coverage
 from coverage.backward import StringIO
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 
 class SingletonApiTest(CoverageTest):

File tests/test_arcs.py

 """Tests for Coverage.py's arc measurement."""
 
 import sys
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 
 class SimpleArcTest(CoverageTest):

File tests/test_cmdline.py

 import coverage.cmdline
 from coverage.misc import ExceptionDuringRun
 
-from test.coveragetest import CoverageTest, OK, ERR
+from tests.coveragetest import CoverageTest, OK, ERR
 
 
 class CmdLineTest(CoverageTest):

File tests/test_codeunit.py

 from coverage.codeunit import code_unit_factory
 from coverage.files import FileLocator
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 # pylint: disable=F0401
 # Unable to import 'aa' (No module named aa)

File tests/test_config.py

 import coverage
 from coverage.misc import CoverageException
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 
 class ConfigTest(CoverageTest):

File tests/test_coverage.py

 import sys
 import coverage
 from coverage.misc import CoverageException
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 
 class TestCoverageTest(CoverageTest):

File tests/test_data.py

 from coverage.data import CoverageData
 from coverage.files import PathAliases
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 
 DATA_1 = { 'a.py': {1:None, 2:None}, 'b.py': {3:None} }

File tests/test_execfile.py

 from coverage.execfile import run_python_file, run_python_module
 from coverage.misc import NoSource
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 here = os.path.dirname(__file__)
 

File tests/test_farm.py

 import difflib, filecmp, fnmatch, glob, os, re, shutil, sys
 from nose.plugins.skip import SkipTest
 
-from test.backtest import run_command, execfile      # pylint: disable=W0622
+from tests.backtest import run_command, execfile      # pylint: disable=W0622
 
 from coverage.control import _TEST_NAME_FILE
 
 
 def test_farm(clean_only=False):
     """A test-generating function for nose to find and run."""
-    for fname in glob.glob("test/farm/*/*.py"):
+    for fname in glob.glob("tests/farm/*/*.py"):
         case = FarmTestCase(fname, clean_only)
         yield (case,)
 

File tests/test_files.py

 from coverage.backward import set                   # pylint: disable=W0622
 from coverage.misc import CoverageException
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 
 class FileLocatorTest(CoverageTest):

File tests/test_html.py

 import coverage
 from coverage.misc import NotPython, NoSource
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 class HtmlTestHelpers(CoverageTest):
     """Methods that help with HTML tests."""

File tests/test_misc.py

 
 from coverage.misc import Hasher, file_be_gone
 from coverage import __version__, __url__
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 class HasherTest(CoverageTest):
     """Test our wrapper of md5 hashing."""

File tests/test_oddball.py

 import os, sys
 import coverage
 
-from test.coveragetest import CoverageTest
-from test import osinfo
+from tests.coveragetest import CoverageTest
+from tests import osinfo
 
 class ThreadingTest(CoverageTest):
     """Tests of the threading support."""

File tests/test_parser.py

 """Tests for Coverage.py's code parsing."""
 
 import textwrap
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 from coverage.parser import CodeParser
 
 

File tests/test_phystokens.py

 """Tests for Coverage.py's improved tokenizer."""
 
 import os, re
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 from coverage.phystokens import source_token_lines
 
 

File tests/test_process.py

 from nose.plugins.skip import SkipTest
 import coverage
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 here = os.path.dirname(__file__)
 
     if sys.version_info >= (2, 6):  # Doesn't work in 2.5, and I don't care!
         def test_coverage_run_dashm_is_like_python_dashm(self):
             # These -m commands assume the coverage tree is on the path.
-            out = self.run_command("coverage run -m test.try_execfile")
-            out2 = self.run_command("python -m test.try_execfile")
+            out = self.run_command("coverage run -m tests.try_execfile")
+            out2 = self.run_command("python -m tests.try_execfile")
             self.assertMultiLineEqual(out, out2)
 
     if 0:   # Expected failure

File tests/test_results.py

 """Tests for Coverage.py's results analysis."""
 
 from coverage.results import Numbers
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 
 class NumbersTest(CoverageTest):

File tests/test_summary.py

 import coverage
 from coverage.backward import StringIO
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 class SummaryTest(CoverageTest):
     """Tests of the text summary reporting for coverage.py."""
 
         # Name                                              Stmts   Miss  Cover
         # ---------------------------------------------------------------------
-        # c:/ned/coverage/trunk/test/modules/covmod1            2      0   100%
-        # c:/ned/coverage/trunk/test/zipmods.zip/covmodzip1     2      0   100%
+        # c:/ned/coverage/trunk/tests/modules/covmod1           2      0   100%
+        # c:/ned/coverage/trunk/tests/zipmods.zip/covmodzip1    2      0   100%
         # mycode                                                4      0   100%
         # ---------------------------------------------------------------------
         # TOTAL                                                 8      0   100%
 
         self.assertNotIn("/coverage/__init__/", report)
-        self.assertIn("/test/modules/covmod1 ", report)
-        self.assertIn("/test/zipmods.zip/covmodzip1 ", report)
+        self.assertIn("/tests/modules/covmod1 ", report)
+        self.assertIn("/tests/zipmods.zip/covmodzip1 ", report)
         self.assertIn("mycode ", report)
         self.assertEqual(self.last_line_squeezed(report), "TOTAL 8 0 100%")
 
 
         self.assertEqual(self.line_count(report), 3)
         self.assertNotIn("/coverage/", report)
-        self.assertNotIn("/test/modules/covmod1 ", report)
-        self.assertNotIn("/test/zipmods.zip/covmodzip1 ", report)
+        self.assertNotIn("/tests/modules/covmod1 ", report)
+        self.assertNotIn("/tests/zipmods.zip/covmodzip1 ", report)
         self.assertIn("mycode ", report)
         self.assertEqual(self.last_line_squeezed(report), "mycode 4 0 100%")
 
 
         self.assertEqual(self.line_count(report), 3)
         self.assertNotIn("/coverage/", report)
-        self.assertNotIn("/test/modules/covmod1 ", report)
-        self.assertNotIn("/test/zipmods.zip/covmodzip1 ", report)
+        self.assertNotIn("/tests/modules/covmod1 ", report)
+        self.assertNotIn("/tests/zipmods.zip/covmodzip1 ", report)
         self.assertIn("mycode ", report)
         self.assertEqual(self.last_line_squeezed(report), "mycode 4 0 100%")
 
 
         self.assertEqual(self.line_count(report), 3)
         self.assertNotIn("/coverage/", report)
-        self.assertNotIn("/test/modules/covmod1 ", report)
-        self.assertNotIn("/test/zipmods.zip/covmodzip1 ", report)
+        self.assertNotIn("/tests/modules/covmod1 ", report)
+        self.assertNotIn("/tests/zipmods.zip/covmodzip1 ", report)
         self.assertIn("mycode ", report)
         self.assertEqual(self.last_line_squeezed(report), "mycode 4 0 100%")
 
 
         report = repout.getvalue().replace('\\', '/')
         report = re.sub(r"\s+", " ", report)
-        self.assertIn("test/modules/pkg1/__init__ 1 0 100%", report)
-        self.assertIn("test/modules/pkg2/__init__ 0 0 100%", report)
+        self.assertIn("tests/modules/pkg1/__init__ 1 0 100%", report)
+        self.assertIn("tests/modules/pkg2/__init__ 0 0 100%", report)
 
 
 class ReportingReturnValue(CoverageTest):

File tests/test_testing.py

 
 import os, sys
 from coverage.backward import to_bytes, rpartition
-from test.backunittest import TestCase
-from test.coveragetest import CoverageTest
+from tests.backunittest import TestCase
+from tests.coveragetest import CoverageTest
 
 from coverage.backward import set                   # pylint: disable=W0622
 

File tests/test_xml.py

 import os, re
 import coverage
 
-from test.coveragetest import CoverageTest
+from tests.coveragetest import CoverageTest
 
 class XmlReportTest(CoverageTest):
     """Tests of the XML reports from coverage.py."""
 commands =
     {envpython} setup.py --quiet clean develop
 
-    # Create test/zipmods.zip
+    # Create tests/zipmods.zip
     # Install the egg1 egg
     # Remove the C extension so that we can test the PyTracer
-    {envpython} igor.py zip_mods install_egg remove_extension 
+    {envpython} igor.py zip_mods install_egg remove_extension
 
     # Test with the PyTracer
     {envpython} igor.py test_with_tracer py {posargs}
 
 [testenv:pypy]
 # PyPy has no C extensions
-setenv = 
+setenv =
     COVERAGE_NO_EXTENSION=1