diff --git a/mypy/build.py b/mypy/build.py index ec2d29a73d8b..c76f1bfd28ed 100644 --- a/mypy/build.py +++ b/mypy/build.py @@ -169,8 +169,10 @@ def build(sources: List[BuildSource], if TEST_BUILTINS in flags: # Use stub builtins (to speed up test cases and to make them easier to - # debug). - lib_path.insert(0, os.path.join(os.path.dirname(__file__), 'test', 'data', 'lib-stub')) + # debug). This is a test-only feature, so assume our files are laid out + # as in the source tree. + root_dir = os.path.dirname(os.path.dirname(__file__)) + lib_path.insert(0, os.path.join(root_dir, 'test-data', 'unit', 'lib-stub')) else: for source in sources: if source.path: diff --git a/mypy/test/config.py b/mypy/test/config.py index 83962d6972f8..681f86664d4a 100644 --- a/mypy/test/config.py +++ b/mypy/test/config.py @@ -4,10 +4,11 @@ import typing -PREFIX = '' +this_file_dir = os.path.dirname(os.path.realpath(__file__)) +PREFIX = os.path.dirname(os.path.dirname(this_file_dir)) # Location of test data files such as test case descriptions. -test_data_prefix = os.path.join(PREFIX, 'mypy', 'test', 'data') +test_data_prefix = os.path.join(PREFIX, 'test-data', 'unit') assert os.path.isdir(test_data_prefix), \ 'Test data prefix ({}) not set correctly'.format(test_data_prefix) diff --git a/mypy/test/helpers.py b/mypy/test/helpers.py index d1b5a65a02c9..95abef2501b9 100644 --- a/mypy/test/helpers.py +++ b/mypy/test/helpers.py @@ -6,7 +6,6 @@ from mypy import defaults from mypy.myunit import AssertionFailure -from mypy.test import config from mypy.test.data import DataDrivenTestCase @@ -191,7 +190,7 @@ def clean_up(a: List[str]) -> List[str]: """ res = [] for s in a: - prefix = config.PREFIX + os.sep + prefix = os.sep ss = s for p in prefix, prefix.replace(os.sep, '/'): if p != '/' and p != '//' and p != '\\' and p != '\\\\': diff --git a/mypy/test/testparse.py b/mypy/test/testparse.py index 01baa977b709..dfecdb11c047 100644 --- a/mypy/test/testparse.py +++ b/mypy/test/testparse.py @@ -1,6 +1,4 @@ -"""Tests for the mypy parser - -Test case descriptions are in files test/data/parse[-errors].test.""" +"""Tests for the mypy parser.""" import os.path diff --git a/runtests.py b/runtests.py index 82b42c3f58a4..d6d67bf5294b 100755 --- a/runtests.py +++ b/runtests.py @@ -155,7 +155,7 @@ def add_basic(driver: Driver) -> None: driver.add_mypy('legacy myunit script', 'scripts/myunit') driver.add_flake8('legacy myunit script', 'scripts/myunit') # needs typed_ast installed: - driver.add_mypy('fast-parse', '--fast-parse', 'samples/hello.py') + driver.add_mypy('fast-parse', '--fast-parse', 'test-data/samples/hello.py') def add_selftypecheck(driver: Driver) -> None: @@ -182,8 +182,6 @@ def add_imports(driver: Driver) -> None: # because of *implicit* imports from other modules. for f in find_files('mypy', suffix='.py'): mod = file_to_module(f) - if '.test.data.' in mod: - continue if not mod.endswith('.__main__'): driver.add_python_string('import %s' % mod, 'import %s' % mod) driver.add_flake8('module %s' % mod, f) @@ -235,7 +233,7 @@ def add_stubs(driver: Driver) -> None: def add_stdlibsamples(driver: Driver) -> None: seen = set() # type: Set[str] for version in driver.versions: - stdlibsamples_dir = join(driver.cwd, 'stdlib-samples', version) + stdlibsamples_dir = join(driver.cwd, 'test-data', 'stdlib-samples', version) modules = [] # type: List[str] for f in find_files(stdlibsamples_dir, prefix='test_', suffix='.py'): module = file_to_module(f[len(stdlibsamples_dir) + 1:]) @@ -248,7 +246,7 @@ def add_stdlibsamples(driver: Driver) -> None: def add_samples(driver: Driver) -> None: - for f in find_files('samples', suffix='.py'): + for f in find_files(os.path.join('test-data', 'samples'), suffix='.py'): if 'codec' in f: cwd, bf = os.path.dirname(f), os.path.basename(f) bf = bf[:-len('.py')] diff --git a/setup.cfg b/setup.cfg index 2aeeb50a8935..ea994efe1832 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [flake8] max-line-length = 99 -exclude = mypy/codec/*,mypy/test/data/lib-stub/*,mypy/test/data/fixtures/* +exclude = mypy/codec/* # Thing to ignore: # E251: spaces around default arg value (against our style) # E128: continuation line under-indented (too noisy) diff --git a/samples/bottles.py b/test-data/samples/bottles.py similarity index 100% rename from samples/bottles.py rename to test-data/samples/bottles.py diff --git a/samples/class.py b/test-data/samples/class.py similarity index 100% rename from samples/class.py rename to test-data/samples/class.py diff --git a/samples/cmdline.py b/test-data/samples/cmdline.py similarity index 100% rename from samples/cmdline.py rename to test-data/samples/cmdline.py diff --git a/samples/codec/example.py b/test-data/samples/codec/example.py similarity index 100% rename from samples/codec/example.py rename to test-data/samples/codec/example.py diff --git a/samples/codec/example_non_default_coding.py b/test-data/samples/codec/example_non_default_coding.py similarity index 100% rename from samples/codec/example_non_default_coding.py rename to test-data/samples/codec/example_non_default_coding.py diff --git a/samples/codec/example_utf8_bom.py b/test-data/samples/codec/example_utf8_bom.py similarity index 100% rename from samples/codec/example_utf8_bom.py rename to test-data/samples/codec/example_utf8_bom.py diff --git a/samples/dict.py b/test-data/samples/dict.py similarity index 100% rename from samples/dict.py rename to test-data/samples/dict.py diff --git a/samples/fib.py b/test-data/samples/fib.py similarity index 100% rename from samples/fib.py rename to test-data/samples/fib.py diff --git a/samples/files.py b/test-data/samples/files.py similarity index 100% rename from samples/files.py rename to test-data/samples/files.py diff --git a/samples/for.py b/test-data/samples/for.py similarity index 100% rename from samples/for.py rename to test-data/samples/for.py diff --git a/samples/generators.py b/test-data/samples/generators.py similarity index 100% rename from samples/generators.py rename to test-data/samples/generators.py diff --git a/samples/greet.py b/test-data/samples/greet.py similarity index 100% rename from samples/greet.py rename to test-data/samples/greet.py diff --git a/samples/guess.py b/test-data/samples/guess.py similarity index 100% rename from samples/guess.py rename to test-data/samples/guess.py diff --git a/samples/hello.py b/test-data/samples/hello.py similarity index 100% rename from samples/hello.py rename to test-data/samples/hello.py diff --git a/samples/input.py b/test-data/samples/input.py similarity index 100% rename from samples/input.py rename to test-data/samples/input.py diff --git a/samples/itertool.py b/test-data/samples/itertool.py similarity index 100% rename from samples/itertool.py rename to test-data/samples/itertool.py diff --git a/samples/readme.txt b/test-data/samples/readme.txt similarity index 100% rename from samples/readme.txt rename to test-data/samples/readme.txt diff --git a/samples/regexp.py b/test-data/samples/regexp.py similarity index 100% rename from samples/regexp.py rename to test-data/samples/regexp.py diff --git a/stdlib-samples/3.2/base64.py b/test-data/stdlib-samples/3.2/base64.py similarity index 100% rename from stdlib-samples/3.2/base64.py rename to test-data/stdlib-samples/3.2/base64.py diff --git a/stdlib-samples/3.2/fnmatch.py b/test-data/stdlib-samples/3.2/fnmatch.py similarity index 100% rename from stdlib-samples/3.2/fnmatch.py rename to test-data/stdlib-samples/3.2/fnmatch.py diff --git a/stdlib-samples/3.2/genericpath.py b/test-data/stdlib-samples/3.2/genericpath.py similarity index 100% rename from stdlib-samples/3.2/genericpath.py rename to test-data/stdlib-samples/3.2/genericpath.py diff --git a/stdlib-samples/3.2/getopt.py b/test-data/stdlib-samples/3.2/getopt.py similarity index 100% rename from stdlib-samples/3.2/getopt.py rename to test-data/stdlib-samples/3.2/getopt.py diff --git a/stdlib-samples/3.2/glob.py b/test-data/stdlib-samples/3.2/glob.py similarity index 100% rename from stdlib-samples/3.2/glob.py rename to test-data/stdlib-samples/3.2/glob.py diff --git a/stdlib-samples/3.2/incomplete/logging/__init__.py b/test-data/stdlib-samples/3.2/incomplete/logging/__init__.py similarity index 100% rename from stdlib-samples/3.2/incomplete/logging/__init__.py rename to test-data/stdlib-samples/3.2/incomplete/logging/__init__.py diff --git a/stdlib-samples/3.2/incomplete/urllib/__init__.py b/test-data/stdlib-samples/3.2/incomplete/urllib/__init__.py similarity index 100% rename from stdlib-samples/3.2/incomplete/urllib/__init__.py rename to test-data/stdlib-samples/3.2/incomplete/urllib/__init__.py diff --git a/stdlib-samples/3.2/incomplete/urllib/parse.py b/test-data/stdlib-samples/3.2/incomplete/urllib/parse.py similarity index 100% rename from stdlib-samples/3.2/incomplete/urllib/parse.py rename to test-data/stdlib-samples/3.2/incomplete/urllib/parse.py diff --git a/stdlib-samples/3.2/posixpath.py b/test-data/stdlib-samples/3.2/posixpath.py similarity index 100% rename from stdlib-samples/3.2/posixpath.py rename to test-data/stdlib-samples/3.2/posixpath.py diff --git a/stdlib-samples/3.2/pprint.py b/test-data/stdlib-samples/3.2/pprint.py similarity index 100% rename from stdlib-samples/3.2/pprint.py rename to test-data/stdlib-samples/3.2/pprint.py diff --git a/stdlib-samples/3.2/random.py b/test-data/stdlib-samples/3.2/random.py similarity index 100% rename from stdlib-samples/3.2/random.py rename to test-data/stdlib-samples/3.2/random.py diff --git a/stdlib-samples/3.2/shutil.py b/test-data/stdlib-samples/3.2/shutil.py similarity index 100% rename from stdlib-samples/3.2/shutil.py rename to test-data/stdlib-samples/3.2/shutil.py diff --git a/stdlib-samples/3.2/subprocess.py b/test-data/stdlib-samples/3.2/subprocess.py similarity index 100% rename from stdlib-samples/3.2/subprocess.py rename to test-data/stdlib-samples/3.2/subprocess.py diff --git a/stdlib-samples/3.2/tempfile.py b/test-data/stdlib-samples/3.2/tempfile.py similarity index 100% rename from stdlib-samples/3.2/tempfile.py rename to test-data/stdlib-samples/3.2/tempfile.py diff --git a/stdlib-samples/3.2/test/__init__.py b/test-data/stdlib-samples/3.2/test/__init__.py similarity index 100% rename from stdlib-samples/3.2/test/__init__.py rename to test-data/stdlib-samples/3.2/test/__init__.py diff --git a/stdlib-samples/3.2/test/randv2_32.pck b/test-data/stdlib-samples/3.2/test/randv2_32.pck similarity index 100% rename from stdlib-samples/3.2/test/randv2_32.pck rename to test-data/stdlib-samples/3.2/test/randv2_32.pck diff --git a/stdlib-samples/3.2/test/randv2_64.pck b/test-data/stdlib-samples/3.2/test/randv2_64.pck similarity index 100% rename from stdlib-samples/3.2/test/randv2_64.pck rename to test-data/stdlib-samples/3.2/test/randv2_64.pck diff --git a/stdlib-samples/3.2/test/randv3.pck b/test-data/stdlib-samples/3.2/test/randv3.pck similarity index 100% rename from stdlib-samples/3.2/test/randv3.pck rename to test-data/stdlib-samples/3.2/test/randv3.pck diff --git a/stdlib-samples/3.2/test/subprocessdata/fd_status.py b/test-data/stdlib-samples/3.2/test/subprocessdata/fd_status.py similarity index 100% rename from stdlib-samples/3.2/test/subprocessdata/fd_status.py rename to test-data/stdlib-samples/3.2/test/subprocessdata/fd_status.py diff --git a/stdlib-samples/3.2/test/subprocessdata/input_reader.py b/test-data/stdlib-samples/3.2/test/subprocessdata/input_reader.py similarity index 100% rename from stdlib-samples/3.2/test/subprocessdata/input_reader.py rename to test-data/stdlib-samples/3.2/test/subprocessdata/input_reader.py diff --git a/stdlib-samples/3.2/test/subprocessdata/qcat.py b/test-data/stdlib-samples/3.2/test/subprocessdata/qcat.py similarity index 100% rename from stdlib-samples/3.2/test/subprocessdata/qcat.py rename to test-data/stdlib-samples/3.2/test/subprocessdata/qcat.py diff --git a/stdlib-samples/3.2/test/subprocessdata/qgrep.py b/test-data/stdlib-samples/3.2/test/subprocessdata/qgrep.py similarity index 100% rename from stdlib-samples/3.2/test/subprocessdata/qgrep.py rename to test-data/stdlib-samples/3.2/test/subprocessdata/qgrep.py diff --git a/stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py b/test-data/stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py similarity index 100% rename from stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py rename to test-data/stdlib-samples/3.2/test/subprocessdata/sigchild_ignore.py diff --git a/stdlib-samples/3.2/test/support.py b/test-data/stdlib-samples/3.2/test/support.py similarity index 100% rename from stdlib-samples/3.2/test/support.py rename to test-data/stdlib-samples/3.2/test/support.py diff --git a/stdlib-samples/3.2/test/test_base64.py b/test-data/stdlib-samples/3.2/test/test_base64.py similarity index 100% rename from stdlib-samples/3.2/test/test_base64.py rename to test-data/stdlib-samples/3.2/test/test_base64.py diff --git a/stdlib-samples/3.2/test/test_fnmatch.py b/test-data/stdlib-samples/3.2/test/test_fnmatch.py similarity index 100% rename from stdlib-samples/3.2/test/test_fnmatch.py rename to test-data/stdlib-samples/3.2/test/test_fnmatch.py diff --git a/stdlib-samples/3.2/test/test_genericpath.py b/test-data/stdlib-samples/3.2/test/test_genericpath.py similarity index 100% rename from stdlib-samples/3.2/test/test_genericpath.py rename to test-data/stdlib-samples/3.2/test/test_genericpath.py diff --git a/stdlib-samples/3.2/test/test_getopt.py b/test-data/stdlib-samples/3.2/test/test_getopt.py similarity index 100% rename from stdlib-samples/3.2/test/test_getopt.py rename to test-data/stdlib-samples/3.2/test/test_getopt.py diff --git a/stdlib-samples/3.2/test/test_glob.py b/test-data/stdlib-samples/3.2/test/test_glob.py similarity index 100% rename from stdlib-samples/3.2/test/test_glob.py rename to test-data/stdlib-samples/3.2/test/test_glob.py diff --git a/stdlib-samples/3.2/test/test_posixpath.py b/test-data/stdlib-samples/3.2/test/test_posixpath.py similarity index 100% rename from stdlib-samples/3.2/test/test_posixpath.py rename to test-data/stdlib-samples/3.2/test/test_posixpath.py diff --git a/stdlib-samples/3.2/test/test_pprint.py b/test-data/stdlib-samples/3.2/test/test_pprint.py similarity index 100% rename from stdlib-samples/3.2/test/test_pprint.py rename to test-data/stdlib-samples/3.2/test/test_pprint.py diff --git a/stdlib-samples/3.2/test/test_random.py b/test-data/stdlib-samples/3.2/test/test_random.py similarity index 100% rename from stdlib-samples/3.2/test/test_random.py rename to test-data/stdlib-samples/3.2/test/test_random.py diff --git a/stdlib-samples/3.2/test/test_set.py b/test-data/stdlib-samples/3.2/test/test_set.py similarity index 100% rename from stdlib-samples/3.2/test/test_set.py rename to test-data/stdlib-samples/3.2/test/test_set.py diff --git a/stdlib-samples/3.2/test/test_shutil.py b/test-data/stdlib-samples/3.2/test/test_shutil.py similarity index 100% rename from stdlib-samples/3.2/test/test_shutil.py rename to test-data/stdlib-samples/3.2/test/test_shutil.py diff --git a/stdlib-samples/3.2/test/test_subprocess.py b/test-data/stdlib-samples/3.2/test/test_subprocess.py similarity index 100% rename from stdlib-samples/3.2/test/test_subprocess.py rename to test-data/stdlib-samples/3.2/test/test_subprocess.py diff --git a/stdlib-samples/3.2/test/test_tempfile.py b/test-data/stdlib-samples/3.2/test/test_tempfile.py similarity index 100% rename from stdlib-samples/3.2/test/test_tempfile.py rename to test-data/stdlib-samples/3.2/test/test_tempfile.py diff --git a/stdlib-samples/3.2/test/test_textwrap.py b/test-data/stdlib-samples/3.2/test/test_textwrap.py similarity index 100% rename from stdlib-samples/3.2/test/test_textwrap.py rename to test-data/stdlib-samples/3.2/test/test_textwrap.py diff --git a/stdlib-samples/3.2/test/tf_inherit_check.py b/test-data/stdlib-samples/3.2/test/tf_inherit_check.py similarity index 100% rename from stdlib-samples/3.2/test/tf_inherit_check.py rename to test-data/stdlib-samples/3.2/test/tf_inherit_check.py diff --git a/stdlib-samples/3.2/textwrap.py b/test-data/stdlib-samples/3.2/textwrap.py similarity index 100% rename from stdlib-samples/3.2/textwrap.py rename to test-data/stdlib-samples/3.2/textwrap.py diff --git a/mypy/test/data/check-abstract.test b/test-data/unit/check-abstract.test similarity index 100% rename from mypy/test/data/check-abstract.test rename to test-data/unit/check-abstract.test diff --git a/mypy/test/data/check-basic.test b/test-data/unit/check-basic.test similarity index 100% rename from mypy/test/data/check-basic.test rename to test-data/unit/check-basic.test diff --git a/mypy/test/data/check-bound.test b/test-data/unit/check-bound.test similarity index 100% rename from mypy/test/data/check-bound.test rename to test-data/unit/check-bound.test diff --git a/mypy/test/data/check-classes.test b/test-data/unit/check-classes.test similarity index 100% rename from mypy/test/data/check-classes.test rename to test-data/unit/check-classes.test diff --git a/mypy/test/data/check-dynamic-typing.test b/test-data/unit/check-dynamic-typing.test similarity index 100% rename from mypy/test/data/check-dynamic-typing.test rename to test-data/unit/check-dynamic-typing.test diff --git a/mypy/test/data/check-expressions.test b/test-data/unit/check-expressions.test similarity index 100% rename from mypy/test/data/check-expressions.test rename to test-data/unit/check-expressions.test diff --git a/mypy/test/data/check-fastparse.test b/test-data/unit/check-fastparse.test similarity index 100% rename from mypy/test/data/check-fastparse.test rename to test-data/unit/check-fastparse.test diff --git a/mypy/test/data/check-flags.test b/test-data/unit/check-flags.test similarity index 100% rename from mypy/test/data/check-flags.test rename to test-data/unit/check-flags.test diff --git a/mypy/test/data/check-functions.test b/test-data/unit/check-functions.test similarity index 100% rename from mypy/test/data/check-functions.test rename to test-data/unit/check-functions.test diff --git a/mypy/test/data/check-generic-subtyping.test b/test-data/unit/check-generic-subtyping.test similarity index 100% rename from mypy/test/data/check-generic-subtyping.test rename to test-data/unit/check-generic-subtyping.test diff --git a/mypy/test/data/check-generics.test b/test-data/unit/check-generics.test similarity index 100% rename from mypy/test/data/check-generics.test rename to test-data/unit/check-generics.test diff --git a/mypy/test/data/check-ignore.test b/test-data/unit/check-ignore.test similarity index 100% rename from mypy/test/data/check-ignore.test rename to test-data/unit/check-ignore.test diff --git a/mypy/test/data/check-incremental.test b/test-data/unit/check-incremental.test similarity index 100% rename from mypy/test/data/check-incremental.test rename to test-data/unit/check-incremental.test diff --git a/mypy/test/data/check-inference-context.test b/test-data/unit/check-inference-context.test similarity index 100% rename from mypy/test/data/check-inference-context.test rename to test-data/unit/check-inference-context.test diff --git a/mypy/test/data/check-inference.test b/test-data/unit/check-inference.test similarity index 100% rename from mypy/test/data/check-inference.test rename to test-data/unit/check-inference.test diff --git a/mypy/test/data/check-isinstance.test b/test-data/unit/check-isinstance.test similarity index 100% rename from mypy/test/data/check-isinstance.test rename to test-data/unit/check-isinstance.test diff --git a/mypy/test/data/check-kwargs.test b/test-data/unit/check-kwargs.test similarity index 100% rename from mypy/test/data/check-kwargs.test rename to test-data/unit/check-kwargs.test diff --git a/mypy/test/data/check-lists.test b/test-data/unit/check-lists.test similarity index 100% rename from mypy/test/data/check-lists.test rename to test-data/unit/check-lists.test diff --git a/mypy/test/data/check-modules.test b/test-data/unit/check-modules.test similarity index 100% rename from mypy/test/data/check-modules.test rename to test-data/unit/check-modules.test diff --git a/mypy/test/data/check-multiple-inheritance.test b/test-data/unit/check-multiple-inheritance.test similarity index 100% rename from mypy/test/data/check-multiple-inheritance.test rename to test-data/unit/check-multiple-inheritance.test diff --git a/mypy/test/data/check-namedtuple.test b/test-data/unit/check-namedtuple.test similarity index 100% rename from mypy/test/data/check-namedtuple.test rename to test-data/unit/check-namedtuple.test diff --git a/mypy/test/data/check-optional.test b/test-data/unit/check-optional.test similarity index 100% rename from mypy/test/data/check-optional.test rename to test-data/unit/check-optional.test diff --git a/mypy/test/data/check-overloading.test b/test-data/unit/check-overloading.test similarity index 100% rename from mypy/test/data/check-overloading.test rename to test-data/unit/check-overloading.test diff --git a/mypy/test/data/check-python2.test b/test-data/unit/check-python2.test similarity index 100% rename from mypy/test/data/check-python2.test rename to test-data/unit/check-python2.test diff --git a/mypy/test/data/check-semanal-error.test b/test-data/unit/check-semanal-error.test similarity index 100% rename from mypy/test/data/check-semanal-error.test rename to test-data/unit/check-semanal-error.test diff --git a/mypy/test/data/check-statements.test b/test-data/unit/check-statements.test similarity index 100% rename from mypy/test/data/check-statements.test rename to test-data/unit/check-statements.test diff --git a/mypy/test/data/check-super.test b/test-data/unit/check-super.test similarity index 100% rename from mypy/test/data/check-super.test rename to test-data/unit/check-super.test diff --git a/mypy/test/data/check-tuples.test b/test-data/unit/check-tuples.test similarity index 100% rename from mypy/test/data/check-tuples.test rename to test-data/unit/check-tuples.test diff --git a/mypy/test/data/check-type-aliases.test b/test-data/unit/check-type-aliases.test similarity index 100% rename from mypy/test/data/check-type-aliases.test rename to test-data/unit/check-type-aliases.test diff --git a/mypy/test/data/check-type-checks.test b/test-data/unit/check-type-checks.test similarity index 100% rename from mypy/test/data/check-type-checks.test rename to test-data/unit/check-type-checks.test diff --git a/mypy/test/data/check-type-promotion.test b/test-data/unit/check-type-promotion.test similarity index 100% rename from mypy/test/data/check-type-promotion.test rename to test-data/unit/check-type-promotion.test diff --git a/mypy/test/data/check-typevar-values.test b/test-data/unit/check-typevar-values.test similarity index 100% rename from mypy/test/data/check-typevar-values.test rename to test-data/unit/check-typevar-values.test diff --git a/mypy/test/data/check-unions.test b/test-data/unit/check-unions.test similarity index 100% rename from mypy/test/data/check-unions.test rename to test-data/unit/check-unions.test diff --git a/mypy/test/data/check-unreachable-code.test b/test-data/unit/check-unreachable-code.test similarity index 100% rename from mypy/test/data/check-unreachable-code.test rename to test-data/unit/check-unreachable-code.test diff --git a/mypy/test/data/check-unsupported.test b/test-data/unit/check-unsupported.test similarity index 100% rename from mypy/test/data/check-unsupported.test rename to test-data/unit/check-unsupported.test diff --git a/mypy/test/data/check-varargs.test b/test-data/unit/check-varargs.test similarity index 100% rename from mypy/test/data/check-varargs.test rename to test-data/unit/check-varargs.test diff --git a/mypy/test/data/check-weak-typing.test b/test-data/unit/check-weak-typing.test similarity index 100% rename from mypy/test/data/check-weak-typing.test rename to test-data/unit/check-weak-typing.test diff --git a/mypy/test/data/cmdline.test b/test-data/unit/cmdline.test similarity index 100% rename from mypy/test/data/cmdline.test rename to test-data/unit/cmdline.test diff --git a/mypy/test/data/fixtures/__new__.py b/test-data/unit/fixtures/__new__.py similarity index 100% rename from mypy/test/data/fixtures/__new__.py rename to test-data/unit/fixtures/__new__.py diff --git a/mypy/test/data/fixtures/alias.py b/test-data/unit/fixtures/alias.py similarity index 100% rename from mypy/test/data/fixtures/alias.py rename to test-data/unit/fixtures/alias.py diff --git a/mypy/test/data/fixtures/args.py b/test-data/unit/fixtures/args.py similarity index 100% rename from mypy/test/data/fixtures/args.py rename to test-data/unit/fixtures/args.py diff --git a/mypy/test/data/fixtures/bool-simple.py b/test-data/unit/fixtures/bool-simple.py similarity index 100% rename from mypy/test/data/fixtures/bool-simple.py rename to test-data/unit/fixtures/bool-simple.py diff --git a/mypy/test/data/fixtures/bool.py b/test-data/unit/fixtures/bool.py similarity index 100% rename from mypy/test/data/fixtures/bool.py rename to test-data/unit/fixtures/bool.py diff --git a/mypy/test/data/fixtures/classmethod.py b/test-data/unit/fixtures/classmethod.py similarity index 100% rename from mypy/test/data/fixtures/classmethod.py rename to test-data/unit/fixtures/classmethod.py diff --git a/mypy/test/data/fixtures/complex.py b/test-data/unit/fixtures/complex.py similarity index 100% rename from mypy/test/data/fixtures/complex.py rename to test-data/unit/fixtures/complex.py diff --git a/mypy/test/data/fixtures/dict.py b/test-data/unit/fixtures/dict.py similarity index 100% rename from mypy/test/data/fixtures/dict.py rename to test-data/unit/fixtures/dict.py diff --git a/mypy/test/data/fixtures/exception.py b/test-data/unit/fixtures/exception.py similarity index 100% rename from mypy/test/data/fixtures/exception.py rename to test-data/unit/fixtures/exception.py diff --git a/mypy/test/data/fixtures/for.py b/test-data/unit/fixtures/for.py similarity index 100% rename from mypy/test/data/fixtures/for.py rename to test-data/unit/fixtures/for.py diff --git a/mypy/test/data/fixtures/function.py b/test-data/unit/fixtures/function.py similarity index 100% rename from mypy/test/data/fixtures/function.py rename to test-data/unit/fixtures/function.py diff --git a/mypy/test/data/fixtures/isinstance.py b/test-data/unit/fixtures/isinstance.py similarity index 100% rename from mypy/test/data/fixtures/isinstance.py rename to test-data/unit/fixtures/isinstance.py diff --git a/mypy/test/data/fixtures/isinstancelist.py b/test-data/unit/fixtures/isinstancelist.py similarity index 100% rename from mypy/test/data/fixtures/isinstancelist.py rename to test-data/unit/fixtures/isinstancelist.py diff --git a/mypy/test/data/fixtures/list.py b/test-data/unit/fixtures/list.py similarity index 100% rename from mypy/test/data/fixtures/list.py rename to test-data/unit/fixtures/list.py diff --git a/mypy/test/data/fixtures/module.py b/test-data/unit/fixtures/module.py similarity index 100% rename from mypy/test/data/fixtures/module.py rename to test-data/unit/fixtures/module.py diff --git a/mypy/test/data/fixtures/module_all.py b/test-data/unit/fixtures/module_all.py similarity index 100% rename from mypy/test/data/fixtures/module_all.py rename to test-data/unit/fixtures/module_all.py diff --git a/mypy/test/data/fixtures/ops.py b/test-data/unit/fixtures/ops.py similarity index 100% rename from mypy/test/data/fixtures/ops.py rename to test-data/unit/fixtures/ops.py diff --git a/mypy/test/data/fixtures/primitives.py b/test-data/unit/fixtures/primitives.py similarity index 100% rename from mypy/test/data/fixtures/primitives.py rename to test-data/unit/fixtures/primitives.py diff --git a/mypy/test/data/fixtures/property.py b/test-data/unit/fixtures/property.py similarity index 100% rename from mypy/test/data/fixtures/property.py rename to test-data/unit/fixtures/property.py diff --git a/mypy/test/data/fixtures/python2.py b/test-data/unit/fixtures/python2.py similarity index 100% rename from mypy/test/data/fixtures/python2.py rename to test-data/unit/fixtures/python2.py diff --git a/mypy/test/data/fixtures/set.py b/test-data/unit/fixtures/set.py similarity index 100% rename from mypy/test/data/fixtures/set.py rename to test-data/unit/fixtures/set.py diff --git a/mypy/test/data/fixtures/slice.py b/test-data/unit/fixtures/slice.py similarity index 100% rename from mypy/test/data/fixtures/slice.py rename to test-data/unit/fixtures/slice.py diff --git a/mypy/test/data/fixtures/staticmethod.py b/test-data/unit/fixtures/staticmethod.py similarity index 100% rename from mypy/test/data/fixtures/staticmethod.py rename to test-data/unit/fixtures/staticmethod.py diff --git a/mypy/test/data/fixtures/transform.py b/test-data/unit/fixtures/transform.py similarity index 100% rename from mypy/test/data/fixtures/transform.py rename to test-data/unit/fixtures/transform.py diff --git a/mypy/test/data/fixtures/tuple-simple.py b/test-data/unit/fixtures/tuple-simple.py similarity index 100% rename from mypy/test/data/fixtures/tuple-simple.py rename to test-data/unit/fixtures/tuple-simple.py diff --git a/mypy/test/data/fixtures/tuple.py b/test-data/unit/fixtures/tuple.py similarity index 100% rename from mypy/test/data/fixtures/tuple.py rename to test-data/unit/fixtures/tuple.py diff --git a/mypy/test/data/fixtures/union.py b/test-data/unit/fixtures/union.py similarity index 100% rename from mypy/test/data/fixtures/union.py rename to test-data/unit/fixtures/union.py diff --git a/mypy/test/data/lib-stub/__builtin__.py b/test-data/unit/lib-stub/__builtin__.py similarity index 100% rename from mypy/test/data/lib-stub/__builtin__.py rename to test-data/unit/lib-stub/__builtin__.py diff --git a/mypy/test/data/lib-stub/abc.py b/test-data/unit/lib-stub/abc.py similarity index 100% rename from mypy/test/data/lib-stub/abc.py rename to test-data/unit/lib-stub/abc.py diff --git a/mypy/test/data/lib-stub/builtins.py b/test-data/unit/lib-stub/builtins.py similarity index 100% rename from mypy/test/data/lib-stub/builtins.py rename to test-data/unit/lib-stub/builtins.py diff --git a/mypy/test/data/lib-stub/collections.py b/test-data/unit/lib-stub/collections.py similarity index 100% rename from mypy/test/data/lib-stub/collections.py rename to test-data/unit/lib-stub/collections.py diff --git a/mypy/test/data/lib-stub/typing.py b/test-data/unit/lib-stub/typing.py similarity index 100% rename from mypy/test/data/lib-stub/typing.py rename to test-data/unit/lib-stub/typing.py diff --git a/mypy/test/data/parse-errors.test b/test-data/unit/parse-errors.test similarity index 100% rename from mypy/test/data/parse-errors.test rename to test-data/unit/parse-errors.test diff --git a/mypy/test/data/parse-python2.test b/test-data/unit/parse-python2.test similarity index 100% rename from mypy/test/data/parse-python2.test rename to test-data/unit/parse-python2.test diff --git a/mypy/test/data/parse.test b/test-data/unit/parse.test similarity index 100% rename from mypy/test/data/parse.test rename to test-data/unit/parse.test diff --git a/mypy/test/data/python2eval.test b/test-data/unit/python2eval.test similarity index 100% rename from mypy/test/data/python2eval.test rename to test-data/unit/python2eval.test diff --git a/mypy/test/data/pythoneval-asyncio.test b/test-data/unit/pythoneval-asyncio.test similarity index 100% rename from mypy/test/data/pythoneval-asyncio.test rename to test-data/unit/pythoneval-asyncio.test diff --git a/mypy/test/data/pythoneval-enum.test b/test-data/unit/pythoneval-enum.test similarity index 100% rename from mypy/test/data/pythoneval-enum.test rename to test-data/unit/pythoneval-enum.test diff --git a/mypy/test/data/pythoneval.test b/test-data/unit/pythoneval.test similarity index 100% rename from mypy/test/data/pythoneval.test rename to test-data/unit/pythoneval.test diff --git a/mypy/test/data/semanal-abstractclasses.test b/test-data/unit/semanal-abstractclasses.test similarity index 100% rename from mypy/test/data/semanal-abstractclasses.test rename to test-data/unit/semanal-abstractclasses.test diff --git a/mypy/test/data/semanal-basic.test b/test-data/unit/semanal-basic.test similarity index 100% rename from mypy/test/data/semanal-basic.test rename to test-data/unit/semanal-basic.test diff --git a/mypy/test/data/semanal-classes.test b/test-data/unit/semanal-classes.test similarity index 100% rename from mypy/test/data/semanal-classes.test rename to test-data/unit/semanal-classes.test diff --git a/mypy/test/data/semanal-errors.test b/test-data/unit/semanal-errors.test similarity index 100% rename from mypy/test/data/semanal-errors.test rename to test-data/unit/semanal-errors.test diff --git a/mypy/test/data/semanal-expressions.test b/test-data/unit/semanal-expressions.test similarity index 100% rename from mypy/test/data/semanal-expressions.test rename to test-data/unit/semanal-expressions.test diff --git a/mypy/test/data/semanal-modules.test b/test-data/unit/semanal-modules.test similarity index 100% rename from mypy/test/data/semanal-modules.test rename to test-data/unit/semanal-modules.test diff --git a/mypy/test/data/semanal-namedtuple.test b/test-data/unit/semanal-namedtuple.test similarity index 100% rename from mypy/test/data/semanal-namedtuple.test rename to test-data/unit/semanal-namedtuple.test diff --git a/mypy/test/data/semanal-python2.test b/test-data/unit/semanal-python2.test similarity index 100% rename from mypy/test/data/semanal-python2.test rename to test-data/unit/semanal-python2.test diff --git a/mypy/test/data/semanal-statements.test b/test-data/unit/semanal-statements.test similarity index 100% rename from mypy/test/data/semanal-statements.test rename to test-data/unit/semanal-statements.test diff --git a/mypy/test/data/semanal-symtable.test b/test-data/unit/semanal-symtable.test similarity index 100% rename from mypy/test/data/semanal-symtable.test rename to test-data/unit/semanal-symtable.test diff --git a/mypy/test/data/semanal-typealiases.test b/test-data/unit/semanal-typealiases.test similarity index 100% rename from mypy/test/data/semanal-typealiases.test rename to test-data/unit/semanal-typealiases.test diff --git a/mypy/test/data/semanal-typeinfo.test b/test-data/unit/semanal-typeinfo.test similarity index 100% rename from mypy/test/data/semanal-typeinfo.test rename to test-data/unit/semanal-typeinfo.test diff --git a/mypy/test/data/semanal-types.test b/test-data/unit/semanal-types.test similarity index 100% rename from mypy/test/data/semanal-types.test rename to test-data/unit/semanal-types.test diff --git a/mypy/test/data/stubgen.test b/test-data/unit/stubgen.test similarity index 100% rename from mypy/test/data/stubgen.test rename to test-data/unit/stubgen.test diff --git a/mypy/test/data/typexport-basic.test b/test-data/unit/typexport-basic.test similarity index 100% rename from mypy/test/data/typexport-basic.test rename to test-data/unit/typexport-basic.test