Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save damian1996/72221d74ea5d7373234653455163c248 to your computer and use it in GitHub Desktop.
Save damian1996/72221d74ea5d7373234653455163c248 to your computer and use it in GitHub Desktop.
Errors pytest coala-bears
__________________________________________________________________________ VultureBearTest.test_used_variable ___________________________________________________________________________
self = <tests.python.VultureBearTest.VultureBearTest testMethod=test_used_variable>
def test_used_variable(self):
> self.verify_results('used_variable.py', {})
tests/python/VultureBearTest.py:63:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/python/VultureBearTest.py:59: in verify_results
for item in self.get_results(load_testfile(test_file)))
tests/python/VultureBearTest.py:53: in get_results
return list(self.uut.run())
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
filenames = ['/tmp/tmpaee462aa.py']
def _find_unused_code(filenames):
"""
:param filenames: List of filenames to check.
:return: Generator of Result objects.
"""
vulture = Vulture()
vulture.scavenge(filenames)
> for item in vulture.get_unused_code():
E AttributeError: 'Vulture' object has no attribute 'get_unused_code'
bears/python/VultureBear.py:14: AttributeError
--------------------------------------------------------------------------------- Captured stdout call ----------------------------------------------------------------------------------
starting parse of '/usr/bin/python3 -m pip show vulture'
returning CommandNode(command=['/usr/bin/python3'] redirects={})
returning CommandNode(command=['-m'] redirects={})
returning CommandNode(command=['pip'] redirects={})
returning CommandNode(command=['show'] redirects={})
returning CommandNode(command=['vulture'] redirects={})
returning CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={})
returning CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={})
returning CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={})
returning CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={})
started: CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={}), None, False
Command('/usr/bin/python3 -m pip show vulture') created
About to call Popen: ['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'], {'stdout': -1, 'stderr': -1, 'stdin': None}
Popen: Command('/usr/bin/python3 -m pip show vulture'), {'stdout': -1, 'stderr': -1, 'stdin': None} -> {'stdout': <_io.BufferedReader name=8>, '_communication_started': False, 'universal_newlines': False, '_closed_child_pipe_fds': True, '_input': None, '_waitpid_lock': <unlocked _thread.lock object at 0x7f4a0dbf9788>, 'stdin': None, 'stderr': <_io.BufferedReader name=14>, 'pid': 4484, 'returncode': None, '_child_created': True, 'args': ['/usr/bin/python3', '-m', 'pip', 'show', 'vulture']}
Created thread Thread-322 as reader for Capture-321
Capture-321: reader thread about to read line
Capture-321: reader thread kicked off, waiting start
Capture-321: reader thread now started
Created thread Thread-323 as reader for Capture-322
Capture-322: reader thread about to read line
Capture-322: reader thread kicked off, waiting start
Capture-322: reader thread now started
about to wait for process
queued chunk of length 14: b'Name: vulture\n'
queued chunk of length 14: b'Version: 0.10\n'
queued chunk of length 24: b'Summary: Find dead code\n'
queued chunk of length 54: b'Home-page: https://bitbucket.o'
queued chunk of length 22: b'Author: Jendrik Seipp\n'
queued chunk of length 34: b'Author-email: jendrikseipp@web'
queued chunk of length 13: b'License: MIT\n'
queued chunk of length 49: b'Location: /usr/local/lib/pytho'
queued chunk of length 11: b'Requires: \n'
queued chunk of length 25: b'Required-by: coala-bears\n'
Capture-322: finished reading stream <_io.BufferedReader name=14>
Capture-321: finished reading stream <_io.BufferedReader name=8>
returning Command('/usr/bin/python3 -m pip show vulture') (Popen(returncode=0 stdin=None stdout=<_io.BufferedReader name=8> stderr=<_io.BufferedReader name=14>))
pipeline closing
----------------------------------------------------------------------------------- Captured log call -----------------------------------------------------------------------------------
__init__.py 810 DEBUG starting parse of '/usr/bin/python3 -m pip show vulture'
__init__.py 952 DEBUG returning CommandNode(command=['/usr/bin/python3'] redirects={})
__init__.py 952 DEBUG returning CommandNode(command=['-m'] redirects={})
__init__.py 952 DEBUG returning CommandNode(command=['pip'] redirects={})
__init__.py 952 DEBUG returning CommandNode(command=['show'] redirects={})
__init__.py 952 DEBUG returning CommandNode(command=['vulture'] redirects={})
__init__.py 895 DEBUG returning CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={})
__init__.py 878 DEBUG returning CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={})
__init__.py 849 DEBUG returning CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={})
__init__.py 833 DEBUG returning CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={})
__init__.py 1266 DEBUG started: CommandNode(command=['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'] redirects={}), None, False
__init__.py 595 DEBUG Command('/usr/bin/python3 -m pip show vulture') created
__init__.py 631 DEBUG About to call Popen: ['/usr/bin/python3', '-m', 'pip', 'show', 'vulture'], {'stdout': -1, 'stderr': -1, 'stdin': None}
__init__.py 634 DEBUG Popen: Command('/usr/bin/python3 -m pip show vulture'), {'stdout': -1, 'stderr': -1, 'stdin': None} -> {'stdout': <_io.BufferedReader name=8>, '_communication_started': False, 'universal_newlines': False, '_closed_child_pipe_fds': True, '_input': None, '_waitpid_lock': <unlocked _thread.lock object at 0x7f4a0dbf9788>, 'stdin': None, 'stderr': <_io.BufferedReader name=14>, 'pid': 4484, 'returncode': None, '_child_created': True, 'args': ['/usr/bin/python3', '-m', 'pip', 'show', 'vulture']}
__init__.py 212 DEBUG Created thread Thread-322 as reader for Capture-321
__init__.py 234 DEBUG Capture-321: reader thread about to read line
__init__.py 216 DEBUG Capture-321: reader thread kicked off, waiting start
__init__.py 218 DEBUG Capture-321: reader thread now started
__init__.py 212 DEBUG Created thread Thread-323 as reader for Capture-322
__init__.py 234 DEBUG Capture-322: reader thread about to read line
__init__.py 216 DEBUG Capture-322: reader thread kicked off, waiting start
__init__.py 218 DEBUG Capture-322: reader thread now started
__init__.py 653 DEBUG about to wait for process
__init__.py 244 DEBUG queued chunk of length 14: b'Name: vulture\n'
__init__.py 244 DEBUG queued chunk of length 14: b'Version: 0.10\n'
__init__.py 244 DEBUG queued chunk of length 24: b'Summary: Find dead code\n'
__init__.py 244 DEBUG queued chunk of length 54: b'Home-page: https://bitbucket.o'
__init__.py 244 DEBUG queued chunk of length 22: b'Author: Jendrik Seipp\n'
__init__.py 244 DEBUG queued chunk of length 34: b'Author-email: jendrikseipp@web'
__init__.py 244 DEBUG queued chunk of length 13: b'License: MIT\n'
__init__.py 244 DEBUG queued chunk of length 49: b'Location: /usr/local/lib/pytho'
__init__.py 244 DEBUG queued chunk of length 11: b'Requires: \n'
__init__.py 244 DEBUG queued chunk of length 25: b'Required-by: coala-bears\n'
__init__.py 253 DEBUG Capture-322: finished reading stream <_io.BufferedReader name=14>
__init__.py 253 DEBUG Capture-321: finished reading stream <_io.BufferedReader name=8>
__init__.py 657 DEBUG returning Command('/usr/bin/python3 -m pip show vulture') (Popen(returncode=0 stdin=None stdout=<_io.BufferedReader name=8> stderr=<_io.BufferedReader name=14>))
__init__.py 1100 DEBUG pipeline closing
_________________________________________________________________________ ShellCheckBearTest.test_invalid_files _________________________________________________________________________
self = <coalib.testing.LocalBearTestHelper.verify_local_bear.<locals>.LocalBearTest testMethod=test_invalid_files>
def test_invalid_files(self):
self.assertIsInstance(invalid_files, (list, tuple))
for file in invalid_files:
self.check_validity(self.uut,
file.splitlines(keepends=True),
filename,
valid=False,
force_linebreaks=force_linebreaks,
create_tempfile=create_tempfile,
> tempfile_kwargs=tempfile_kwargs)
/usr/local/lib/python3.5/dist-packages/coalib/testing/LocalBearTestHelper.py:344:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.5/dist-packages/coalib/testing/LocalBearTestHelper.py:135: in check_validity
settings=settings,
/usr/local/lib/python3.5/dist-packages/coalib/testing/LocalBearTestHelper.py:175: in check_invalidity
self.assertNotEqual(len(bear_output), 0, msg=msg)
E AssertionError: 0 == 0 : The local bear 'ShellCheckBear' yields no result although it should.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment