Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Speccer

3,006 views

Published on

Speccer is a wrapper of sort for unittest module. In essence it makes writing tests a lot less painful. Check out this presentation to see a simple example of how it works.

Note that the code Speccer uses is exactly equivalent to the code shown at first! So as you can see you can write a lot by writing a little.

Published in: Technology, Sports
  • Be the first to comment

  • Be the first to like this

Speccer

  1. 1. Speccer Juho Vepsäläinen
  2. 2. import randomimport unittestclass TestSequenceFunctions(unittest.TestCase): def setUp(self): self.seq = range(10) def test_choice(self): element = random.choice(self.seq) self.assertTrue(element in self.seq)if __name__ == __main__: unittest.main()
  3. 3. import randomset up seq = range(10)chooses element in sequence random.choice(seq) in seq
  4. 4. https://github.com/bebraw/speccer
  5. 5. References● http://www.flickr.com/photos/ctbto/4926598654/ - nuke● http://www.flickr. com/photos/lesmontsdore/5513104816/ - python● http://www.flickr.com/photos/jeffeaton/2778624999/ - beans● http://www.flickr. com/photos/ecoagriculture/2424054385/ - sloth

×