python - Should I include the function that I am testing inside the unittest file, or should I just import it in the unittest file? -



python - Should I include the function that I am testing inside the unittest file, or should I just import it in the unittest file? -

i want inquire if should include function testing within unittest file (such have 1 file, unittest.py), or should import in unittest file (i have 2 files, unittest.py , function.py). seeing both methods when read in web, find first testing described redundant.

two separate files of course. thought unit test should non-intrusive , should sit down in own file, set under test directory and/or named test_*. have never seen people set in same file unless trivial demo.

python unit-testing function

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -