Skip to content

Instantly share code, notes, and snippets.

@peplin
Created May 13, 2015 18:18
A nose2 plugin to render the name of tests as something you can copy and paste and provide to nose at the command line to run an individual test
from nose2.events import Plugin
class AddressableTestNameOutcome(Plugin):
"""Render name of each test in results as as something you can copy and
paste and provide directly to nose2 at the command line to run a single
test.
"""
configSection = 'addressable_test_name'
def describeTest(self, event):
cls = event.test.__class__
event.description = "%s.%s.%s" % (
cls.__module__, cls.__name__, event.test._testMethodName)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment