def setUp(self):

    @slash.hooks.register
    def tests_loaded(tests):
        TestMetadataTest.loaded_tests = tests
    super(TestMetadataTest, self).setUp()
    self.root = self.get_new_path()
    self.filename = os.path.join(self.root, 'testfile.py')
    with open(self.filename, 'w') as f:
        f.write(_TEST_FILE_TEMPLATE)
    with slash.Session() as s:
        self.session = run_tests_assert_success(self.filename, session=s)
        self.tests = self.loaded_tests
    self.results = list(self.session.results.iter_test_results())
    self.results.sort(key=(lambda result: str(result.test_metadata)))
def setUp(self):

    @slash.hooks.register
    def tests_loaded(tests):
        TestMetadataTest.loaded_tests = tests
    super(TestMetadataTest, self).setUp()
    self.root = self.get_new_path()
    self.filename = os.path.join(self.root, 'testfile.py')
    with open(self.filename, 'w') as f:
        f.write(_TEST_FILE_TEMPLATE)
    with slash.Session() as s:
        self.session = run_tests_assert_success(self.filename, session=s)
        self.tests = self.loaded_tests
    self.results = list(self.session.results.iter_test_results())
    self.results.sort(key=(lambda result: str(result.test_metadata)))