Best Python code snippet using slash
log.py
Source:log.py
...158 def _error_added_filter(record, handler): # pylint: disable=unused-argument159 return record.extra.get('highlight')160 handler, log_path = self._get_file_log_handler(path, symlink=None, bubble=True, filter=_error_added_filter)161 if log_path and self.session.results.current is self.session.results.global_result:162 self.session.results.global_result.add_extra_log_path(log_path)163 return handler.applicationbound()164 def _get_silenced_logs_context(self):165 if not config.root.log.silence_loggers:166 return ExitStack()167 return SilencedLoggersHandler(config.root.log.silence_loggers).applicationbound()168 def _get_file_log_handler(self, subpath, symlink, bubble=False, filter=None):169 root_path = config.root.log.root170 if root_path is None or subpath is None:171 log_path = None172 if bubble:173 handler = NoopHandler()174 else:175 handler = logbook.NullHandler(filter=filter)176 else:...
test_result.py
Source:test_result.py
...143 expected_logs.append(logs_dir.join('files').join(log_subpath))144 assert result.get_log_path() is log_path145 assert result.get_log_paths() == expected_logs146 for extra_log in extra_logs:147 result.add_extra_log_path(extra_log)148 assert result.get_log_paths() == expected_logs + extra_logs149@pytest.mark.parametrize('error_adder', (Result.add_error, Result.add_failure))150def test_result_not_started_with_errors(error_adder):151 result = Result()152 assert not result.is_started()153 assert result.is_not_run()154 error_adder(result, "error")155 assert not result.is_started()156 assert not result.is_not_run()157class SessionResultTest(TestCase):158 def setUp(self):159 super(SessionResultTest, self).setUp()160 self.results = [161 Result() for _ in range(10)...
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!!