Tag Archives: python

Python : generating unittests on the fly

When creating python unit tests you need to create a method in a unittest class. The problem however is when you don’t know until the code is running what these tests will be. In my particular case I need to run a series of tests against a number of Solaris packages. But I won’t know what the packages will be in advance. Continue reading Python : generating unittests on the fly

Python: Searching for a string within a list – List comprehension

The simple way to search for a string in a list is just to use ‘if string in list’. eg:

Continue reading Python: Searching for a string within a list – List comprehension