I'm using Py.Test to test functions in a Python Flask app.

I have the tests passing fine when I use one "app\_test.py" file that contains all the fixtures and tests. Now that I've split the fixtures into their own module, and separated the tests into different modules which each import the fixtures module I'm running into issues. 

If I run tests on each module individually, everything passes fine:
`pytest tests/test_1.py`, `pytest tests/test_2.py`, `pytest tests/test_3.py`, etc. However trouble starts if I want to run all the tests in sequence with one command, e.g. `pytest tests`.

I get the first module of tests passing and all future ones report an error:

```
AssertionError: A setup function was called after the first request was handled.  
This usually indicates a bug in the application where a module was not imported 
and decorators or other functionality was called too late.
E  To fix this make sure to import all your view modules, database models 
and everything related at a central place before the application starts 
serving requests.

```

All the tests and fixtures in one file looks something like this:

```
# app_test.py

from flask_app import create_app
@pytest.fixtures(scope="session")
def app(request):
    app = create_app()
    with app.app_context():
        yield app

@pytest.fixture(scope="session"):
def client(request, app):
    client = app.test_client()
    return client

def test1(client):
    # test body

def test2(client):
    # test body

...

```

I run `$ pytest app_test.py` and everything runs perfectly.

Now let's say we split those into three different modules: fixures.py, test\_1.py and test\_2.py. The code now looks like this.

```
# tests/fixtures.py
from flask_app import create_app
@pytest.fixtures(scope="session")
def app(request):
    app = create_app()
    with app.app_context():
        yield app

@pytest.fixture(scope="session"):
def client(request, app):
    client = app.test_client()
    return client

```

---

```
# tests/test_1.py
from tests.fixtures import app, client
def test_1(client):
    # test body

```

---

```
# tests/test_2.py
from tests.fixtures import app, client
def test_2(client):
    # test body

```

If we run `$ pytest tests` then tests/test\_1.py will pass, and tests/test\_2.py will raise the error.

I've looked at this [gist](https://gist.github.com/peterhurford/09f7dcda0ab04b95c026c60fa49c2a68), and have tried tagging the test functions with `@pytest.mark.usefixture` with no success.

How can one run Py.Test with modularized fixtures on a directory that contains multiple test files?