def script(workspace: Workspace, uri: str) -> Script: """Simplifies getting jedi Script""" project_ = project(workspace) document = workspace.get_document(uri) return Script( code=document.source, path=document.path, project=project_, environment=get_cached_default_environment(), )
def discover_tests_in_workspace( self, workspace: Workspace) -> List[TestSuiteInfoResult]: rval: List[TestSuiteInfoResult] = [] for doc_uri in workspace.documents: document = workspace.get_document(doc_uri) if self.document_validator.is_tool_document(document): xml_document = XmlDocumentParser().parse(document) test_suite = self._get_test_suite_from_document(xml_document) if test_suite: rval.append(test_suite) return rval
def script(workspace: Workspace, uri: str) -> Script: """Simplifies getting jedi Script.""" project_ = project(workspace) document = workspace.get_document(uri) return Script(code=document.source, path=document.path, project=project_)