Skip to content

Commit

Permalink
Directory changed: test->tests. Adapt.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedbat committed Feb 2, 2013
1 parent c19232a commit f3c8815
Show file tree
Hide file tree
Showing 30 changed files with 67 additions and 67 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ include requirements.txt
include igor.py
include tox.ini

recursive-include test *
recursive-include tests *
recursive-include doc *.rst
global-exclude *.pyc
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
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
Expand All @@ -20,14 +20,14 @@ clean:
-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)
Expand All @@ -37,7 +37,7 @@ lint:
pep8:
pep8 --filename=*.py --ignore=E401,E301 --repeat coverage

tests:
test:
tox -e py27 $(ARGS)

metacov:
Expand Down
8 changes: 4 additions & 4 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ To limit tox to just a few versions of Python, use the ``-e`` switch::

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
Expand All @@ -129,8 +129,8 @@ I try to keep the coverage.py as clean as possible. I use pylint to alert me
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
Expand Down
2 changes: 1 addition & 1 deletion howto.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@

- To run the Javascript tests:

open test/js/index.html in variety of browsers.
open tests/js/index.html in variety of browsers.
14 changes: 7 additions & 7 deletions igor.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ def do_test_with_tracer(tracer, *noseargs):

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():
Expand All @@ -132,7 +132,7 @@ 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(
Expand Down Expand Up @@ -188,10 +188,10 @@ def check_files(root, patterns, **kwargs):

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")
Expand Down
2 changes: 1 addition & 1 deletion metacov.ini
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ data_file = $COVERAGE_HOME/.coverage.meta
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
Expand Down
8 changes: 4 additions & 4 deletions tests/coveragetest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
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."""
Expand Down Expand Up @@ -452,8 +452,8 @@ def run_command_status(self, cmd, status=0):
# 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
Expand Down
4 changes: 2 additions & 2 deletions tests/farm/html/gold_other/blah_blah_other.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@


<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>
Expand All @@ -19,7 +19,7 @@

<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'>
Expand Down
2 changes: 1 addition & 1 deletion tests/farm/html/gold_other/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ <h1>Coverage report:
<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>
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import coverage
from coverage.backward import StringIO

from test.coveragetest import CoverageTest
from tests.coveragetest import CoverageTest


class SingletonApiTest(CoverageTest):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_arcs.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests for Coverage.py's arc measurement."""

import sys
from test.coveragetest import CoverageTest
from tests.coveragetest import CoverageTest


class SimpleArcTest(CoverageTest):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_cmdline.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_codeunit.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import coverage
from coverage.misc import CoverageException

from test.coveragetest import CoverageTest
from tests.coveragetest import CoverageTest


class ConfigTest(CoverageTest):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_coverage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import coverage
from coverage.misc import CoverageException
from test.coveragetest import CoverageTest
from tests.coveragetest import CoverageTest


class TestCoverageTest(CoverageTest):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
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} }
Expand Down
2 changes: 1 addition & 1 deletion tests/test_execfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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__)

Expand Down
4 changes: 2 additions & 2 deletions tests/test_farm.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
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,)

Expand Down
2 changes: 1 addition & 1 deletion tests/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_html.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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."""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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."""
Expand Down
4 changes: 2 additions & 2 deletions tests/test_oddball.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
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."""
Expand Down
2 changes: 1 addition & 1 deletion tests/test_parser.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Tests for Coverage.py's code parsing."""

import textwrap
from test.coveragetest import CoverageTest
from tests.coveragetest import CoverageTest
from coverage.parser import CodeParser


Expand Down
2 changes: 1 addition & 1 deletion tests/test_phystokens.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""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


Expand Down
6 changes: 3 additions & 3 deletions tests/test_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from nose.plugins.skip import SkipTest
import coverage

from test.coveragetest import CoverageTest
from tests.coveragetest import CoverageTest

here = os.path.dirname(__file__)

Expand Down Expand Up @@ -327,8 +327,8 @@ def test_coverage_run_is_like_python(self):
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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_results.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""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):
Expand Down
Loading

0 comments on commit f3c8815

Please sign in to comment.