Flask-SQLAlchemy Unittest Runs Twice

I've set up my project up like this:

- proj/
  - proj.py
  - views.py
  - tests.py
  - models.py
  - settings.py
- setup.py

In proj.py I defined app and db:

from flask import Flask
from flask_sqlalchemy import SQLAlchemy

from proj import settings

app = Flask(__name__)
db = SQLAlchemy(app)

views just contains the hooks for the app. models contains the SQLAlchemy models. The relevant portions of test:

from flask import Flask
from flask_testing import (

class SqlalchemyUnittest(TestCase):

    TESTING = True

    def create_app(self):
        proj.app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///'
        proj.app.config['PRESERVE_CONTEXT_ON_EXCEPTION'] = False
        proj.app.config['TESTING'] = True
        proj.app.config['DEBUG'] = True
        proj.app.testing = True
        proj.app.debug = True
        return proj.app

    def setUp(self):

    def tearDown(self):

class TestSomething(SqlalchemyUnittest):

    def test_something(self):
        self.assertEqual(1, 1)

And then in the actual execution...

test_something (proj.tests.TestSomething) ... ok
test_something (proj.tests.TestSomething) ... ok

Ran 2 tests in 0.010s


The odd thing is that on some of the tests they pass one one of the runs, but fail on another, though the tests are independent of the environment (e.g. the database state). It almost seems as though there are .pyc files hanging around, but I've deleted all the .pyc files and __pycache__ directories and still get the same result.

Any ideas why? Thanks.

tl;dr Python unit tests run twice, and sometimes give varying results.