title: How can I get nose to find class attributes defined on a base test class?
body: <p>I'm getting some integration tests running against the database, and I'd like to have a structure that looks something like this:</p>
  
  <pre><code>class OracleMixin(object):
      oracle = True
      # ... set up the oracle connection
  
  class SqlServerMixin(object):
      sql_server = True
      # ... set up the sql server connection
  
  class SomeTests(object):
      integration = True
      # ... define test methods here
  
  class test_OracleSomeTests(SomeTests, OracleMixin):
      pass
  
  class test_SqlServerSomeTests(SomeTests, SqlServerMixin):
      pass
  </code></pre>
  
  <p>This way, I can run SQL Server tests and Oracle tests separately like this:</p>
  
  <pre><code>nosetests -a oracle
  nosetests -a sql_server
  </code></pre>
  
  <p>Or all integration tests like this:</p>
  
  <pre><code>nosetests -a integration
  </code></pre>
  
  <p>However, it appears that nose will only look for attributes on the subclass, not on the base class.  Thus I have to define the test classes like this or the tests won't run:</p>
  
  <pre><code>class test_OracleSomeTests(SomeTests, OracleMixin):
      oracle = True
      integration = True
  
  class test_SqlServerSomeTests(SomeTests, SqlServerMixin):
      sql_server = True
      integration = True
  </code></pre>
  
  <p>This is a bit tedious to maintain.  Any ideas how to get around this?  If I was just dealing with one base class, I'd just use a metaclass and define the attributes on each class.  But I get an uneasy feeling about having a metaclass for the test class, a metaclass for Oracle, and a metaclass for SQL Server.</p>