title: How to use @pytest.mark with base classes?
body: <p>I'm using py.test 2.2.4 and my testcases are organised as follows:</p>
  
  <pre class="lang-python prettyprint-override"><code>import pytest 
  
  class BaseTests():
      def test_base_test(self):
          pass
  
  @pytest.mark.linuxonly
  class TestLinuxOnlyLocal(BaseTests):
      pass
  
  @pytest.mark.windowsonly
  class TestWindowsOnly(BaseTests):
      pass
  
  class TestEverywhere(BaseTests):
      pass
  </code></pre>
  
  <p>The problem with this setup is that the decorator of the first class is leaking into the second class. When I create a conftest.py as follows:</p>
  
  <pre class="lang-python prettyprint-override"><code>import pytest
  import sys 
  
  def pytest_runtest_setup(item):
      print "\n %s keywords: %s" % (item.getmodpath(), item.keywords)
      skip_message = None
      if 'windowsonly' in item.keywords and not sys.platform.startswith('win'):
          skip_message =  "Skipped: Windows only test"
  
      if 'linuxonly' in item.keywords and not sys.platform.startswith('linux'):
          skip_message = "Skipped: Linux only test"
  
      if skip_message is not None:
          print skip_message
          pytest.skip(skip_message)
  </code></pre>
  
  <p>When I execute this set the output shows that the markings seems to stack up:
  </p>
  
  <pre class="lang-none prettyprint-override"><code>$ py.test  --capture=no
  ========================================== test session starts ===========================================
  platform linux2 -- Python 2.7.3 -- pytest-2.2.4
  collected 3 items 
  
  test_cases.py 
   TestLinuxOnlyLocal.test_base_test keywords: {'linuxonly': &lt;MarkInfo 'linuxonly' args=() kwargs={}&gt;, 'test_base_test': True}
  .
   TestWindowsOnly.test_base_test keywords: {'linuxonly': &lt;MarkInfo 'linuxonly' args=() kwargs={}&gt;, 'test_base_test': True, 'windowsonly': &lt;MarkInfo 'windowsonly' args=() kwargs={}&gt;}
  Skipped: Windows only test
  s
   TestEverywhere.test_base_test keywords: {'linuxonly': &lt;MarkInfo 'linuxonly' args=() kwargs={}&gt;, 'test_base_test': True, 'windowsonly': &lt;MarkInfo 'windowsonly' args=() kwargs={}&gt;}
  Skipped: Windows only test
  s
  
  ================================== 1 passed, 2 skipped in 0.01 seconds ===================================
  </code></pre>
  
  <p>So I want to understand how it is possible that these markings leak between the sub-classes, and how this can be fixed/solved (the tests cases will live in the base class but the sub-classes will set up the necessary platform abstraction). </p>