# Path: moult/log.py
# def set_level(level):
#     def emit(self, record):
# class ColorOutputHandler(logging.Handler):
# 
# Path: moult/utils.py
# def installed_packages(local=False):
#     installed = []
# 
#     for dist in get_installed_distributions(local_only=local):
#         pym = PyModule(dist.project_name, dist.version, dist.location)
#         if dist.has_metadata('top_level.txt'):
#             pym.set_import_names(list(dist.get_metadata_lines('top_level.txt')))
# 
#         pym.local = dist_is_local(dist)
#         pym.user = dist_in_usersite(dist)
#         pym._dependencies = [dep.project_name for dep in dist.requires()]
# 
#         for filename in iter_dist_files(dist):
#             if not filename.startswith(dist.location):
#                 if is_script(filename):
#                     pym.installed_scripts.append(filename)
#                 else:
#                     pym.installed_files.append(filename)
# 
#         if pym.installed_scripts or pym.name in ignore_packages:
#             pym.hidden = True
# 
#         installed.append(pym)
# 
#     for pym in installed[:]:
#         for dep in pym._dependencies:
#             if dep == 'argparse':
#                 # Since I'm only testing with Python 2.7, skip any requirements
#                 # for argparse.
#                 continue
#             pymc = find_package(dep, installed, True)
#             if not pymc:
#                 pymc = PyModule(dep, 'MISSING', missing=True)
#                 installed.append(pymc)
#             pymc.add_dependant(pym)
#             pym.add_dependency(pymc)
# 
#     return installed


import os
import copy
import pytest
import logging
from moult import log
from moult.utils import installed_packages
from py._path.local import LocalPath
            return False

        for prissy in self.pristine_data.visit():
            assert prissy.ext != '.pyc', \
                'Pristine has Python bytecode indicating execution from pristine directory!'

            rel = prissy.relto(self.pristine_data)
            tmp = self.tmpdata.join(rel)

            if prissy.check(dir=True):
                assert tmp.check(dir=True), 'Data integirty test failed: %s' % rel
            elif prissy.check(file=True):
                assert tmp.check(file=True), 'Data integirty test failed: %s' % rel
                assert prissy.computehash() == tmp.computehash(), 'Hash mismatch: %s' % rel

        for tmp in self.tmpdata.visit():
            if '.git' in tmp.strpath or '__pycache__' in tmp.strpath or tmp.ext == '.pyc':
                continue

            rel = tmp.relto(self.tmpdata)
            prissy = self.pristine_data.join(rel)

            if tmp.check(dir=True):
                assert prissy.check(dir=True), 'Directory created in tmpdir: %s' % rel
            elif tmp.check(file=True):
                assert prissy.check(file=True), 'File created in tmpdir: %s' % rel

        return True

    def copy_installed(self):

# Path: moult/log.py
# def set_level(level):
#     def emit(self, record):
# class ColorOutputHandler(logging.Handler):
# 
# Path: moult/utils.py
# def installed_packages(local=False):
#     installed = []
# 
#     for dist in get_installed_distributions(local_only=local):
#         pym = PyModule(dist.project_name, dist.version, dist.location)
#         if dist.has_metadata('top_level.txt'):
#             pym.set_import_names(list(dist.get_metadata_lines('top_level.txt')))
# 
#         pym.local = dist_is_local(dist)
#         pym.user = dist_in_usersite(dist)
#         pym._dependencies = [dep.project_name for dep in dist.requires()]
# 
#         for filename in iter_dist_files(dist):
#             if not filename.startswith(dist.location):
#                 if is_script(filename):
#                     pym.installed_scripts.append(filename)
#                 else:
#                     pym.installed_files.append(filename)
# 
#         if pym.installed_scripts or pym.name in ignore_packages:
#             pym.hidden = True
# 
#         installed.append(pym)
# 
#     for pym in installed[:]:
#         for dep in pym._dependencies:
#             if dep == 'argparse':
#                 # Since I'm only testing with Python 2.7, skip any requirements
#                 # for argparse.
#                 continue
#             pymc = find_package(dep, installed, True)
#             if not pymc:
#                 pymc = PyModule(dep, 'MISSING', missing=True)
#                 installed.append(pymc)
#             pymc.add_dependant(pym)
#             pym.add_dependency(pymc)
# 
#     return installed


# Path: tests/conftest.py
import os
import copy
import pytest
import logging
from moult import log
from moult.utils import installed_packages
from py._path.local import LocalPath

            return False

        for prissy in self.pristine_data.visit():
            assert prissy.ext != '.pyc', \
                'Pristine has Python bytecode indicating execution from pristine directory!'

            rel = prissy.relto(self.pristine_data)
            tmp = self.tmpdata.join(rel)

            if prissy.check(dir=True):
                assert tmp.check(dir=True), 'Data integirty test failed: %s' % rel
            elif prissy.check(file=True):
                assert tmp.check(file=True), 'Data integirty test failed: %s' % rel
                assert prissy.computehash() == tmp.computehash(), 'Hash mismatch: %s' % rel

        for tmp in self.tmpdata.visit():
            if '.git' in tmp.strpath or '__pycache__' in tmp.strpath or tmp.ext == '.pyc':
                continue

            rel = tmp.relto(self.tmpdata)
            prissy = self.pristine_data.join(rel)

            if tmp.check(dir=True):
                assert prissy.check(dir=True), 'Directory created in tmpdir: %s' % rel
            elif tmp.check(file=True):
                assert prissy.check(file=True), 'File created in tmpdir: %s' % rel

        return True

    def copy_installed(self):

        if not self.installed_packages: