Best Python code snippet using avocado_python
runner_nrunner.py
Source:runner_nrunner.py
...324 self._determine_status_server(test_suite, "nrunner.status_server_uri"),325 job.unique_id,326 )327 # pylint: disable=W0201328 self.runtime_tasks = graph.get_tasks_in_topological_order()329 # Start the status server330 asyncio.ensure_future(self.status_server.serve_forever())331 if test_suite.config.get("nrunner.shuffle"):332 random.shuffle(self.runtime_tasks)333 test_ids = [334 rt.task.identifier335 for rt in self.runtime_tasks336 if rt.task.category == "test"337 ]338 tsm = TaskStateMachine(self.runtime_tasks, self.status_repo)339 spawner_name = test_suite.config.get("nrunner.spawner")340 spawner = SpawnerDispatcher(test_suite.config, job)[spawner_name].obj341 max_running = min(342 test_suite.config.get("nrunner.max_parallel_tasks"), len(self.runtime_tasks)...
runtime.py
Source:runtime.py
...228 for dependency, task in zip(tasks, tasks[1:]):229 self.graph[task] = task230 self.graph[dependency] = dependency231 task.dependencies.append(dependency)232 def get_tasks_in_topological_order(self):233 """Computes the topological order of runtime tasks in graph234 :returns: runtime tasks in topological order235 :rtype: list236 """237 def topological_order_util(vertex, visited, topological_order):238 visited[vertex] = True239 for v in vertex.dependencies:240 if not visited[v]:241 topological_order_util(v, visited, topological_order)242 topological_order.append(vertex)243 visited = dict.fromkeys(self.graph, False)244 topological_order = []245 for vertex in self.graph.values():246 if not visited[vertex]:...
test_task_runtime.py
Source:test_task_runtime.py
...57 config = {"resolver.references": [test.path]}58 suite = TestSuite.from_config(config=config)59 tests = suite.get_test_variants()60 graph = RuntimeTaskGraph(tests, suite.name, 1, "")61 runtime_tests = graph.get_tasks_in_topological_order()62 self.assertTrue(runtime_tests[0].task.identifier.name.endswith("test_a"))63 self.assertTrue(runtime_tests[1].task.identifier.name.endswith("hello"))64 self.assertTrue(runtime_tests[2].task.identifier.name.endswith("test_b"))65 self.assertTrue(runtime_tests[3].task.identifier.name.endswith("hello"))66 self.assertTrue(runtime_tests[4].task.identifier.name.endswith("test_c"))67 def test_multiple_dependencies(self):68 with script.Script(69 os.path.join(self.tmpdir.name, "test_multiple_dependencies.py"),70 MULTIPLE_REQUIREMENT,71 ) as test:72 config = {"resolver.references": [test.path]}73 suite = TestSuite.from_config(config=config)74 tests = suite.get_test_variants()75 graph = RuntimeTaskGraph(tests, suite.name, 1, "")76 runtime_tests = graph.get_tasks_in_topological_order()77 self.assertTrue(runtime_tests[0].task.identifier.name.endswith("hello"))78 self.assertTrue(runtime_tests[1].task.identifier.name.endswith("test_a"))79 self.assertTrue(runtime_tests[2].task.identifier.name.endswith("test_b"))80 self.assertTrue(runtime_tests[3].task.identifier.name.endswith("hello"))81 self.assertTrue(runtime_tests[4].task.identifier.name.endswith("-foo-bar-"))...
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Get 100 minutes of automation test minutes FREE!!