import json
from nose.plugins.attrib import attr


class ElasticTestMixin(object):

    def checkQuery(self, query, json_output, is_raw_query=False):
        if is_raw_query:
            raw_query = query
        else:
            raw_query = query.raw_query
        msg = "Expected Query:\n{}\nGenerated Query:\n{}".format(
            json.dumps(json_output, indent=4),
            json.dumps(raw_query, indent=4),
        )
        # NOTE: This method thinks [a, b, c] != [b, c, a]
        self.assertEqual(raw_query, json_output, msg=msg)


def es_test(test):
    """Decorator for tagging ElasticSearch tests

    :param test: A test class, method, or function.
    """
    return attr(es_test=True)(test)

import json
from nose.plugins.attrib import attr
from nose.tools import nottest


class ElasticTestMixin(object):

    def checkQuery(self, query, json_output, is_raw_query=False):
        if is_raw_query:
            raw_query = query
        else:
            raw_query = query.raw_query
        msg = "Expected Query:\n{}\nGenerated Query:\n{}".format(
            json.dumps(json_output, indent=4),
            json.dumps(raw_query, indent=4),
        )
        # NOTE: This method thinks [a, b, c] != [b, c, a]
        self.assertEqual(raw_query, json_output, msg=msg)


@nottest
def es_test(test):
    """Decorator for tagging ElasticSearch tests

    :param test: A test class, method, or function.
    """
    return attr(es_test=True)(test)

Mark es_test decorator as nottest
Mark es_test decorator as nottest

Second try...
  import json
  from nose.plugins.attrib import attr
+ from nose.tools import nottest
  
  
  class ElasticTestMixin(object):
  
      def checkQuery(self, query, json_output, is_raw_query=False):
          if is_raw_query:
              raw_query = query
          else:
              raw_query = query.raw_query
          msg = "Expected Query:\n{}\nGenerated Query:\n{}".format(
              json.dumps(json_output, indent=4),
              json.dumps(raw_query, indent=4),
          )
          # NOTE: This method thinks [a, b, c] != [b, c, a]
          self.assertEqual(raw_query, json_output, msg=msg)
  
  
+ @nottest
  def es_test(test):
      """Decorator for tagging ElasticSearch tests
  
      :param test: A test class, method, or function.
      """
      return attr(es_test=True)(test)
  
Mark es_test decorator as nottest
## Code Before:
import json
from nose.plugins.attrib import attr


class ElasticTestMixin(object):

    def checkQuery(self, query, json_output, is_raw_query=False):
        if is_raw_query:
            raw_query = query
        else:
            raw_query = query.raw_query
        msg = "Expected Query:\n{}\nGenerated Query:\n{}".format(
            json.dumps(json_output, indent=4),
            json.dumps(raw_query, indent=4),
        )
        # NOTE: This method thinks [a, b, c] != [b, c, a]
        self.assertEqual(raw_query, json_output, msg=msg)


def es_test(test):
    """Decorator for tagging ElasticSearch tests

    :param test: A test class, method, or function.
    """
    return attr(es_test=True)(test)

## Instruction:
Mark es_test decorator as nottest
## Code After:
import json
from nose.plugins.attrib import attr
from nose.tools import nottest


class ElasticTestMixin(object):

    def checkQuery(self, query, json_output, is_raw_query=False):
        if is_raw_query:
            raw_query = query
        else:
            raw_query = query.raw_query
        msg = "Expected Query:\n{}\nGenerated Query:\n{}".format(
            json.dumps(json_output, indent=4),
            json.dumps(raw_query, indent=4),
        )
        # NOTE: This method thinks [a, b, c] != [b, c, a]
        self.assertEqual(raw_query, json_output, msg=msg)


@nottest
def es_test(test):
    """Decorator for tagging ElasticSearch tests

    :param test: A test class, method, or function.
    """
    return attr(es_test=True)(test)
