import pytest
from tornado import gen

_used_fixture = False


@gen.coroutine
def dummy(io_loop):
    yield gen.Task(io_loop.add_callback)
    raise gen.Return(True)


@pytest.fixture(scope='module')
def preparations():
    global _used_fixture
    _used_fixture = True


pytestmark = pytest.mark.usefixtures('preparations')


@pytest.mark.xfail(pytest.__version__ < '2.7.0',
                   reason='py.test 2.7 adds hookwrapper, fixes collection')
@pytest.mark.gen_test
def test_uses_pytestmark_fixtures(io_loop):
    assert (yield dummy(io_loop))
    assert _used_fixture

import pytest
from tornado import gen

_used_fixture = False


@gen.coroutine
def dummy(io_loop):
    yield gen.Task(io_loop.add_callback)
    raise gen.Return(True)


@pytest.fixture(scope='module')
def preparations():
    global _used_fixture
    _used_fixture = True


pytestmark = pytest.mark.usefixtures('preparations')


@pytest.mark.xfail(pytest.__version__ < '2.7.0',
                   reason='py.test 2.7 adds hookwrapper, fixes collection')
@pytest.mark.gen_test
def test_uses_pytestmark_fixtures(io_loop):
    assert (yield dummy(io_loop))
    assert _used_fixture

class TestClass:
    @pytest.mark.gen_test
    def test_uses_pytestmark_fixtures(self, io_loop):
        assert (yield dummy(io_loop))
        assert _used_fixture

Add some test for method signature inspection
Add some test for method signature inspection

  import pytest
  from tornado import gen
  
  _used_fixture = False
  
  
  @gen.coroutine
  def dummy(io_loop):
      yield gen.Task(io_loop.add_callback)
      raise gen.Return(True)
  
  
  @pytest.fixture(scope='module')
  def preparations():
      global _used_fixture
      _used_fixture = True
  
  
  pytestmark = pytest.mark.usefixtures('preparations')
  
  
  @pytest.mark.xfail(pytest.__version__ < '2.7.0',
                     reason='py.test 2.7 adds hookwrapper, fixes collection')
  @pytest.mark.gen_test
  def test_uses_pytestmark_fixtures(io_loop):
      assert (yield dummy(io_loop))
      assert _used_fixture
  
+ class TestClass:
+     @pytest.mark.gen_test
+     def test_uses_pytestmark_fixtures(self, io_loop):
+         assert (yield dummy(io_loop))
+         assert _used_fixture
+ 
Add some test for method signature inspection
## Code Before:
import pytest
from tornado import gen

_used_fixture = False


@gen.coroutine
def dummy(io_loop):
    yield gen.Task(io_loop.add_callback)
    raise gen.Return(True)


@pytest.fixture(scope='module')
def preparations():
    global _used_fixture
    _used_fixture = True


pytestmark = pytest.mark.usefixtures('preparations')


@pytest.mark.xfail(pytest.__version__ < '2.7.0',
                   reason='py.test 2.7 adds hookwrapper, fixes collection')
@pytest.mark.gen_test
def test_uses_pytestmark_fixtures(io_loop):
    assert (yield dummy(io_loop))
    assert _used_fixture

## Instruction:
Add some test for method signature inspection
## Code After:
import pytest
from tornado import gen

_used_fixture = False


@gen.coroutine
def dummy(io_loop):
    yield gen.Task(io_loop.add_callback)
    raise gen.Return(True)


@pytest.fixture(scope='module')
def preparations():
    global _used_fixture
    _used_fixture = True


pytestmark = pytest.mark.usefixtures('preparations')


@pytest.mark.xfail(pytest.__version__ < '2.7.0',
                   reason='py.test 2.7 adds hookwrapper, fixes collection')
@pytest.mark.gen_test
def test_uses_pytestmark_fixtures(io_loop):
    assert (yield dummy(io_loop))
    assert _used_fixture

class TestClass:
    @pytest.mark.gen_test
    def test_uses_pytestmark_fixtures(self, io_loop):
        assert (yield dummy(io_loop))
        assert _used_fixture
