croach / Flask-Fixtures

A simple library for adding database fixtures for unit tests using nothing but JSON or YAML.
MIT License
63 stars 30 forks source link

Fix issue with existing fixtures sticking around between tests #2

Open croach opened 10 years ago

croach commented 10 years ago

If you use fixtures with a class that does it's own setup and teardown any tables that were already created stick around and that means that any data within them stick around as well. We should use the 'checkfirst' parameter on db.create_all and set it to False to make sure it creates all tables from scratch each time. Though, we might want to consider not using it on class level fixtures (need more research here).