Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

One test fails #1083

Open
yurivict opened this issue Dec 23, 2023 · 1 comment
Open

One test fails #1083

yurivict opened this issue Dec 23, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@yurivict
Copy link

Describe the bug

========================================================================================== ERRORS ===========================================================================================
_________________________________________________________________________________ ERROR at setup of test_id _________________________________________________________________________________
file /usr/ports/devel/py-bandit/work-py39/bandit-1.7.6/bandit/core/test_properties.py, line 49
  def test_id(id_val):
E       fixture 'id_val' not found
>       available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, cov, doctest_namespace, monkeypatch, no_cover, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, testrun_uid, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, worker_id
>       use 'pytest --fixtures [testpath]' for help on them.

/usr/ports/devel/py-bandit/work-py39/bandit-1.7.6/bandit/core/test_properties.py:49
========================================================================================= FAILURES ==========================================================================================
____________________________________________________________________ BanditBaselineToolTests.test_main_subprocess_error _____________________________________________________________________
'NoneType' object is not iterable

During handling of the above exception, another exception occurred:
NOTE: Incompatible Exception Representation, displaying natively:

testtools.testresult.real._StringException: SystemExit: 2

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/ports/devel/py-bandit/work-py39/bandit-1.7.6/tests/unit/cli/test_baseline.py", line 189, in test_main_subprocess_error
    self.assertRaisesRegex(SystemExit, "3", baseline.main)
  File "/usr/local/lib/python3.9/unittest/case.py", line 1282, in assertRaisesRegex
    return context.handle('assertRaisesRegex', args, kwargs)
  File "/usr/local/lib/python3.9/unittest/case.py", line 201, in handle
    callable_obj(*args, **kwargs)
  File "/usr/local/lib/python3.9/unittest/case.py", line 239, in __exit__
    self._raiseFailure('"{}" does not match "{}"'.format(
  File "/usr/local/lib/python3.9/unittest/case.py", line 163, in _raiseFailure
    raise self.test_case.failureException(msg)
AssertionError: "3" does not match "2"
----------------------------------------------------------------------------------- Captured stdout call ------------------------------------------------------------------------------------
[   INFO ] No output format specified, using terminal
[  ERROR ] Bandit baseline must not be called with the -o option
------------------------------------------------------------------------------------- Captured log call -------------------------------------------------------------------------------------
INFO     bandit.cli.baseline:baseline.py:195 No output format specified, using terminal
ERROR    bandit.cli.baseline:baseline.py:234 Bandit baseline must not be called with the -o option
===================================================================================== warnings summary ======================================================================================
tests/unit/core/test_test_set.py::test_plugin
  Expected None, but tests/unit/core/test_test_set.py::test_plugin returned {'Import': [{'name': 'telnet', 'id': 'B401', 'cwe': 319, 'message': 'A telnet-related module is being imported.  Telnet is considered insecure. Use SSH or some other encrypted protocol.', 'qualnames': ['telnetlib'], 'level': 'HIGH'}, {'name': 'marshal', 'id': 'B302', 'cwe': 502, 'message': 'Deserialization with the marshal module is possibly dangerous.', 'qualnames': ['marshal.load', 'marshal.loads'], 'level': 'MEDIUM'}], 'ImportFrom': [{'name': 'telnet', 'id': 'B401', 'cwe': 319, 'message': 'A telnet-related module is being imported.  Telnet is considered insecure. Use SSH or some other encrypted protocol.', 'qualnames': ['telnetlib'], 'level': 'HIGH'}, {'name': 'marshal', 'id': 'B302', 'cwe': 502, 'message': 'Deserialization with the marshal module is possibly dangerous.', 'qualnames': ['marshal.load', 'marshal.loads'], 'level': 'MEDIUM'}], 'Call': [{'name': 'telnet', 'id': 'B401', 'cwe': 319, 'message': 'A telnet-related module is being imported.  Telnet is considered insecure. Use SSH or some other encrypted protocol.', 'qualnames': ['telnetlib'], 'level': 'HIGH'}, {'name': 'marshal', 'id': 'B302', 'cwe': 502, 'message': 'Deserialization with the marshal module is possibly dangerous.', 'qualnames': ['marshal.load', 'marshal.loads'], 'level': 'MEDIUM'}]}, which will be an error in a future version of pytest.  Did you mean to use `assert` instead of `return`?

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================================================== 1 failed, 267 passed, 1 warning, 1 error in 33.86s =====================================================================

Reproduction steps

pytest

Expected behavior

n/a

Bandit version

1.7.6 (Default)

Python version

3.12 (Default)

Additional context

Python-3.9
FreeBSD 13.2

@yurivict yurivict added the bug Something isn't working label Dec 23, 2023
@lukehinds
Copy link
Member

I am not seeing this, do you know which version of python the failure happened against?

See if you can narrow it down to a version tox run -e py3.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants