When writing tests I usually name the modules prefixed with test_ for example spam.py and test_spam.py. This makes finding the tests easy. When testing classes in a module I create a unittest.TestCase derivative with a similar class name, postfixed with Test. e.g. Spam becomes SpamTest (not TestSpam as this sounds like it is a test implementation of Spam). Then class functions are tested by test functions that are prefixed with test_ and postfixed with _testcondition or some other descriptive postfix. I find that this works brilliantly as the original object names are included.
The problem occurs when I want to test module level functions. Following my regular structure I would create a unittest.TestCase derivative with the same name as the function, postfixed with Test. The problem with this is that class names are camel cased and function names are lower cased with underscores to separate words. Ignoring the naming convention some_function becomes SomeFunctionTest. I cannot help but feeling that this is ugly.
What would be a better fit? What is common practice? Is there a 'standard' like pep8 for this? What do you use?
The way you are doing it is the cleanest approach - as long as there is a clear location where people would expect to find the tests for a module level function then I think you are good. The stylistic difference between the function name and the test class name - although an annoyance - isn't significant enough to worry about.
Python unit test naming convention for module functions