Best Python code snippet using prospector_python
test_profile.py
Source:test_profile.py
...30 profile = ProspectorProfile.load('ignores', self._profile_path)31 self.assertEqual(['^tests/', '/migrations/'].sort(), profile.ignore_patterns.sort())32 def test_disable_tool(self):33 profile = ProspectorProfile.load('pylint_disabled', self._profile_path)34 self.assertFalse(profile.is_tool_enabled('pylint'))35 self.assertTrue(profile.is_tool_enabled('pep8') is None)36 def test_load_plugins(self):37 profile = ProspectorProfile.load('pylint_load_plugins', self._profile_path)38 self.assertEqual(['first_plugin', 'second_plugin'], profile.pylint['load-plugins'])39class TestProfileInheritance(ProfileTestBase):40 def _example_path(self, testname):41 return os.path.join(os.path.dirname(__file__), 'profiles', 'inheritance', testname)42 def _load(self, testname):43 profile_path = self._profile_path + [self._example_path(testname)]44 return ProspectorProfile.load('start', profile_path)45 def test_simple_inheritance(self):46 profile = ProspectorProfile.load('inherittest3', self._profile_path, allow_shorthand=False)47 disable = profile.pylint['disable']48 disable.sort()49 self.assertEqual(['I0002', 'I0003', 'raw-checker-failed'], disable)50 def test_disable_tool_inheritance(self):51 profile = ProspectorProfile.load('pep8_and_pylint_disabled', self._profile_path)52 self.assertFalse(profile.is_tool_enabled('pylint'))53 self.assertFalse(profile.is_tool_enabled('pep8'))54 def test_precedence(self):55 profile = self._load('precedence')56 self.assertTrue(profile.is_tool_enabled('pylint'))57 self.assertTrue('expression-not-assigned' in profile.get_disabled_messages('pylint'))58 def test_strictness_equivalence(self):59 profile = self._load('strictness_equivalence')60 medium_strictness = ProspectorProfile.load('strictness_medium', self._profile_path)61 self.assertListEqual(sorted(profile.pylint['disable']), sorted(medium_strictness.pylint['disable']))62 def test_shorthand_inheritance(self):63 profile = self._load('shorthand_inheritance')64 high_strictness = ProspectorProfile.load('strictness_high', self._profile_path,65 # don't implicitly add things66 allow_shorthand=False,67 # but do include the profiles that the start.yaml will68 forced_inherits=['doc_warnings', 'no_member_warnings']69 )70 self.assertDictEqual(profile.pylint, high_strictness.pylint)71 self.assertDictEqual(profile.pep8, high_strictness.pep8)72 self.assertDictEqual(profile.pyflakes, high_strictness.pyflakes)73 def test_pep8_inheritance(self):74 profile = self._load('pep8')...
toolbar.py
Source:toolbar.py
...74 self.update_tools_data(change["owner"])75 def set_tool_enabled(self, tool_id, enabled):76 tool = self.tools[tool_id]77 self.update_tools_data(tool, { "disabled": not enabled })78 def is_tool_enabled(self, tool_id):79 return not self.tools_data[tool_id]["disabled"]80 def add_tool(self, tool, data={}):81 self.tools[tool.tool_id] = tool82 self.update_tools_data(tool, data)83 if isinstance(tool, HasTraits):84 for trait in self._TOOL_TRAITS:85 if trait in tool.traits():...
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!!