Path: csiph.com!news.mixmin.net!weretis.net!feeder4.news.weretis.net!ecngs!feeder2.ecngs.de!217.188.199.168.MISMATCH!takemy.news.telefonica.de!telefonica.de!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.001 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'run- time': 0.05; 'test,': 0.05; 'testing,': 0.05; 'acceptance': 0.07; 'tests,': 0.07; 'behave': 0.09; 'definition,': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'python.': 0.11; 'server,': 0.15; '8bit%:26': 0.16; '8bit%:32': 0.16; 'combinations': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'tests.': 0.18; 'tests': 0.18; 'library': 0.20; "aren't": 0.22; 'pass': 0.22; 'passing': 0.23; 'discussion': 0.24; 'feature': 0.24; 'testing': 0.25; 'header :User-Agent:1': 0.26; 'header:X-Complaints-To:1': 0.26; 'parameters': 0.27; 'then.': 0.27; 'host': 0.28; 'function': 0.28; 'once.': 0.29; 'code': 0.30; 'call.': 0.30; 'e.g.': 0.30; 'another': 0.32; 'url:python': 0.33; 'usually': 0.33; 'instances': 0.33; 'url:listinfo': 0.34; 'running': 0.34; 'something': 0.35; 'supports': 0.35; 'unit': 0.35; 'there': 0.36; 'url:org': 0.36; 'framework': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:org': 0.37; 'integration': 0.38; 'goes': 0.39; 'test': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'some': 0.40; 'more': 0.63; 'different': 0.63; 'developed': 0.66; 'url:lists': 0.66; 'skip:\xe2 10': 0.70; 'sounds': 0.76; '_o__)': 0.84; 'exercised': 0.84; 'mistakes,': 0.84; 'received:125': 0.84; 'mistakes': 0.95 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Ben Finney Subject: Re: Parametrized Unit Tests Date: Sat, 22 Aug 2015 11:42:50 +1000 References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Gmane-NNTP-Posting-Host: jigong.madmonks.org X-Public-Key-ID: 0xAC128405 X-Public-Key-Fingerprint: 517C F14B B2F3 98B0 CB35 4855 B8B2 4C06 AC12 8405 X-Public-Key-URL: http://www.benfinney.id.au/contact/bfinney-pubkey.asc X-Post-From: Ben Finney User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) Cancel-Lock: sha1:ZUSV0IYAH0p+bD8eEfyCQ0O4bLc= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 38 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1440207786 news.xs4all.nl 23790 [2001:888:2000:d::a6]:53267 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:95543 rambius writes: > I am running one and the same unit tests that test some web > application. I would like to execute them against different servers > that may host different instances of the application. Those aren't unit tests, then. A unit test, by definition, tests a small unit of code; usually one true-or-false assertion about one function call. What you describe sounds more like integration tests or feature tests or acceptance tests; something where large parts of the code base are all exercised at once. > Is there a better a way to pass the server, the user and the password > to the test without resolving to global variables? The ‘testscenarios’ library is one way to have a set of scenarios applied at run-time to produce tests across all combinations . > Although I developed these tests as unit tests they are more of > integration tests. Is there an integration testing framework that > supports a more convenient passing of test parameters / data? You may want to look at behaviour-driven testing, e.g. using Behave . Another resource to use is the ‘testing-in-python’ forum where there is more focussed discussion on testing in Python. -- \ “Repetition leads to boredom, boredom to horrifying mistakes, | `\ horrifying mistakes to God-I-wish-I-was-still-bored, and it | _o__) goes downhill from there.” —Will Larson, 2008-11-04 | Ben Finney