How to use databases within the python unittest framework?
I have a bunch of unittests written in
pythonin which messages (text) of any kind is used. Instead of 'hardcoding' the text examples used for the tests I would like to use a database of some kind (simple text file, pickle file) which contains such test examples, and which can be extended either manually or automatically very easily.
Is there a dedicated framework/module available, or do I do this simply on my own and create a simple text file? Maybe there are some best practices available I can follow?
You might want to look at some of the answers to this question: What are some good approaches to separating test data from test scripts?
It's not specifically aimed at unit tests, but the general principle is similar. If your unit test framework doesn't support a data source attribute or declaration, you could design your own method of using external data sources.