unit testing - Which is the better way to pass data into Python Unittest Redirected STDIN or Pickle? -
short question
best way data python unittest case ?
background
project using python's unittest module automated way execute series of tests need run on many of same type of boards. far fit unittest module designed for; twist each test case needs know run specific information store in django database.
the data needs passed in includes serial number, tested board, date, , other things of nature. worth noting order in boards tested chosen human pulls board x box, predicting serial number not possible.
thoughts
currently, passing required data , test cases via pickle. method works fine in small testing, concern reading , writing same file 100k + times gives lots of room data corruption (+ it's not fast). wrote answer question redirects stdin in way think might work application well.
the next step going wrap gui around these tests. personal goal have ability run tests via command line have gui call same command line functions. reason leaning towards moving redirected stdin.
system / deployment information
required os support: windows xp , windows 7
ideal os support: mac os x , linux
python version: 2.7
any thoughts or comments appreciated.
i have created unittests test against third party service (zoho crm). test service api, need store username , password crendetials.
since premium service , creating open source software, naturally cannot hardcode login credentials source code itself.
so ended using environment variables - work quite well:
here example:
https://github.com/miohtama/mfabrik.zoho/blob/master/mfabrik/zoho/tests.py
as bigger problem think trying enforce unit tests module not supposed in first place not idea. maybe should try write own unit test runner necessary preparements (pulling info, storing results) somewhere.
Comments
Post a Comment