old_contents: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals, absolute_import, division
  from flask.ext.script import Command, Option
  from alchemist import app
  import pytest
  from os import path
  from importlib import import_module
  
  
  class Test(Command):
  
      name = 'test'
  
      option_list = [
          Option(dest='name', nargs='?',
                 help='The name of the component (or project) to test.'),
      ]
  
      capture_all_args = True
  
      def run(self, *args, **kwargs):
  
          # Use the project (package) name if no name was provided.
          # This would execute tests at '<project>/tests'.
  
          name = kwargs.pop('name') or app.application.name
          application = app._get_application_from_name(name)
  
          # Get the test directory.
  
          module = import_module(name)
          directory = path.join(path.dirname(module.__file__), 'tests')
  
          # Register fixture to place the test runner in an application context.
  
          @pytest.fixture(autouse=True, scope='session')
          def fixture_application(request):
              context = application.app_context()
              context.push()
              request.addfinalizer(lambda: context.pop())
  
          # Execute 'py.test' with the remaining arguments.
  
          pytest.main([directory] + list(*args))
  
new_contents: # -*- coding: utf-8 -*-
  from __future__ import unicode_literals, absolute_import, division
  from flask.ext.script import Command, Option
  from alchemist import app
  import pytest
  from os import path
  from importlib import import_module
  
  
  class Test(Command):
  
      name = 'test'
  
      option_list = [
          Option(dest='name', nargs='?',
                 help='The name of the component (or project) to test.'),
      ]
  
      capture_all_args = True
  
      def run(self, *args, **kwargs):
  
          # Use the project (package) name if no name was provided.
          # This would execute tests at '<project>/tests'.
  
          name = kwargs.pop('name') or app.application.name
          application = app._get_application_from_name(name)
  
          # Get the test directory.
  
          module = import_module(name)
          directory = path.join(path.dirname(module.__file__), 'tests')
  
          # Execute 'py.test' with the remaining arguments.
  
          pytest.main([directory] + list(*args))
  
subject: Remove this.