示例#1
0
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(),
    )
示例#2
0
 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
示例#3
0
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_)