Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #108767
| From | Ethan Furman <ethan@stoneleaf.us> |
|---|---|
| Newsgroups | comp.lang.python |
| Subject | Re: Quote of the day |
| Date | 2016-05-18 09:05 -0700 |
| Message-ID | <mailman.9.1463587511.27390.python-list@python.org> (permalink) |
| References | (5 earlier) <mailman.50.1463481565.19823.python-list@python.org> <nhhlr4$s2$1@news.albasani.net> <8e92e249-c46e-4b92-a93b-778879461273@googlegroups.com> <nhi24l$no9$1@news.albasani.net> <573C92CB.9070502@stoneleaf.us> |
On 05/18/2016 08:35 AM, Thomas Mlynarczyk wrote: > On 18/05/16 17:21, Ned Batchelder wrote: >> Ideally, an empty test wouldn't be a success, but I'm not sure how >> the test runner could determine that it was empty. I guess it could >> introspect the test function to see if it had any real code in it, >> but I don't know of a test runner that does that. > > Simple: a function which does not produce at least one "failure" or > "pass" does not test anything. No need to introspect the code. Just > check if the total score of failures and passes has changed after the > function was run. Not so simple: I have tests that do nothing besides build objects. If building the objects raises no errors the test passed. Although, for the benefit of empty tests not passing I could add a do-nothing assert: self.assertTrue(created_obj) (it's a do-nothing because if the object wasn't created the test would have already failed). -- ~Ethan~
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Quote of the day Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-05-17 17:50 +1000
Re: Quote of the day Radek Holý <Radek1@holych.org> - 2016-05-17 10:12 +0200
Re: Quote of the day Marko Rauhamaa <marko@pacujo.net> - 2016-05-17 11:30 +0300
Re: Quote of the day Sivan Greenberg <sivan@vitakka.co> - 2016-05-17 11:53 +0300
Re: Quote of the day Paul Rudin <paul.nospam@rudin.co.uk> - 2016-05-17 10:54 +0100
Re: Quote of the day Chris Angelico <rosuav@gmail.com> - 2016-05-17 20:48 +1000
Re: Quote of the day Marko Rauhamaa <marko@pacujo.net> - 2016-05-17 15:21 +0300
Re: Quote of the day wxjmfauth@gmail.com - 2016-05-17 06:15 -0700
Re: Quote of the day wxjmfauth@gmail.com - 2016-05-18 23:50 -0700
Re: Quote of the day Paul Rudin <paul.nospam@rudin.co.uk> - 2016-05-17 15:27 +0100
Re: Quote of the day Michael Torrie <torriem@gmail.com> - 2016-05-17 13:42 -0600
Re: Quote of the day Marko Rauhamaa <marko@pacujo.net> - 2016-05-17 23:21 +0300
Re: Quote of the day Cem Karan <cfkaran2@gmail.com> - 2016-05-17 06:39 -0400
Re: Quote of the day Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2016-05-18 14:05 +0200
Re: Quote of the day Chris Angelico <rosuav@gmail.com> - 2016-05-18 22:32 +1000
Re: Quote of the day Ned Batchelder <ned@nedbatchelder.com> - 2016-05-18 08:21 -0700
Re: Quote of the day Thomas Mlynarczyk <thomas@mlynarczyk-webdesign.de> - 2016-05-18 17:35 +0200
Re: Quote of the day Ned Batchelder <ned@nedbatchelder.com> - 2016-05-18 08:47 -0700
Re: Quote of the day Ethan Furman <ethan@stoneleaf.us> - 2016-05-18 09:05 -0700
Re: Quote of the day Steven D'Aprano <steve@pearwood.info> - 2016-05-19 02:50 +1000
Re: Quote of the day Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-05-19 10:52 +1200
Re: Quote of the day Ethan Furman <ethan@stoneleaf.us> - 2016-05-18 16:30 -0700
Re: Quote of the day Steven D'Aprano <steve@pearwood.info> - 2016-05-19 10:43 +1000
Re: Quote of the day Ethan Furman <ethan@stoneleaf.us> - 2016-05-18 17:59 -0700
csiph-web