I want to write some unittests for an application that uses MySQL. However, I do not want to connect to a real mysql database, but rather to a temporary one, which does not require any SQL server at all.
Any library (I didn't find anything on Google)? Any design template? Please note that DIP does not work, since I still have to test the introduced class.
There is no good way to do this. You want to run your queries on a real MySQL server, otherwise you do not know whether they will work or not.
, . , Unit Test, . , , - .
python-mock mox ( , SQL-), / MySQL .
, SQLite SQL MySQL , , ORM (Django, SQLObject, SQLAlchemy,...), .