Getting TeamCity to cache test results when using the yield generator in python nose tests

Hi all,

I'm hoping someone knows how to deal with this scenario... Given a scenario when one is running tests via the yield generator pattern via nose in python, how can I get Teamcity to recognize tests between runs, such that each failure that occurs between runs isn't always marked as "new" in Teamcity?

The python context I'm running in has teamcity-nose installed, and all the other necessary dependencies.

For example, imagine running this as your test case generator:

case_data = [1,2,3]

class CheckValue():
    def __init__(self, value):
        self.value = value
        self.description = 'test_%s"
    def __call__(self):
        assertEqual(self.value, 1)

def test_cases():
    for case in case_data:
        yield check_value, case



Running these via nose on the command line reports 2 failed tests, expected results. When running this in Teamcity, one sees the same, with tests named "test_2" and "test_3" as failing. Running the tests multiple times however, these same named tests report as new failures each time.

I understand why, it's a new function reference each time. However, can I work around this somehow, and have Teamcity specifically show test case failures as new *only* when they are truly new?

Thanks in advance.
~a

Please sign in to leave a comment.