Take the 2-minute tour ×
Software Quality Assurance & Testing Stack Exchange is a question and answer site for software quality control experts, automation engineers, and software testers. It's 100% free, no registration required.

I have a bunch of unittests written in python in 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?

share|improve this question
add comment

1 Answer

Alex,

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.