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

[TEST] test_cast_tuple.py - failing test - suggest removing #77

Closed
evelynmitchell opened this issue Dec 29, 2023 · 2 comments
Closed

[TEST] test_cast_tuple.py - failing test - suggest removing #77

evelynmitchell opened this issue Dec 29, 2023 · 2 comments
Assignees
Labels
bug Something isn't working no-issue-activity

Comments

@evelynmitchell
Copy link
Contributor

evelynmitchell commented Dec 29, 2023

I think the traceback is occuring at:

# Test with mock and monkeypatch
def test_cast_tuple_with_mock_and_monkeypatch(monkeypatch):
    def mock_isinstance(val, t):
        return False

    monkeypatch.setattr("builtins.isinstance", mock_isinstance)
    assert cast_tuple((1, 2), 1) == ((1, 2),)

Tracebac

tests/utils/test_cast_tuple.py .....Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/_pytest/main.py", line 271, in wrap_session
    session.exitstatus = doit(config, session) or 0
  File "/usr/local/lib/python3.10/site-packages/_pytest/main.py", line 325, in _main
    config.hook.pytest_runtestloop(session=session)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 152, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python3.10/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 137, in _multicall
    teardown.throw(outcome._exception)
AttributeError: 'tuple' object has no attribute 'throw'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/_pytest/main.py", line 291, in wrap_session
    config.notify_exception(excinfo, config.option)
  File "/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1105, in notify_exception
    excrepr = excinfo.getrepr(
  File "/usr/local/lib/python3.10/site-packages/_pytest/_code/code.py", line 686, in getrepr
    self.traceback[0]._rawentry if self.traceback else None,
  File "/usr/local/lib/python3.10/site-packages/_pytest/_code/code.py", line 583, in traceback
    self._traceback = Traceback(self.tb)
  File "/usr/local/lib/python3.10/site-packages/_pytest/_code/code.py", line 343, in __init__
    super().__init__(tb)
TypeError: 'traceback' object is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File "/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 192, in console_main
    code = main()
  File "/usr/local/lib/python3.10/site-packages/_pytest/config/__init__.py", line 169, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
  File "/usr/local/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 113, in _multicall
    raise exception.with_traceback(exception.__traceback__)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 77, in _multicall
    res = hook_impl.function(*args)
  File "/usr/local/lib/python3.10/site-packages/_pytest/main.py", line 318, in pytest_cmdline_main
    return wrap_session(config, _main)
  File "/usr/local/lib/python3.10/site-packages/_pytest/main.py", line 306, in wrap_session
    config.hook.pytest_sessionfinish(
  File "/usr/local/lib/python3.10/site-packages/pluggy/_hooks.py", line 493, in __call__
    return self._hookexec(self.name, self._hookimpls, kwargs, firstresult)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_manager.py", line 115, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 152, in _multicall
    return outcome.get_result()
  File "/usr/local/lib/python3.10/site-packages/pluggy/_result.py", line 114, in get_result
    raise exc.with_traceback(exc.__traceback__)
  File "/usr/local/lib/python3.10/site-packages/pluggy/_callers.py", line 137, in _multicall
    teardown.throw(outcome._exception)
AttributeError: 'tuple' object has no attribute 'throw'

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
@evelynmitchell evelynmitchell added the bug Something isn't working label Dec 29, 2023
@evelynmitchell evelynmitchell changed the title [BUG] test_cast_tuple.py - failing test - suggest removing [TEST] test_cast_tuple.py - failing test - suggest removing Dec 29, 2023
@evelynmitchell
Copy link
Contributor Author

PR submitted #108

Copy link

Stale issue message

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no-issue-activity
Projects
None yet
Development

No branches or pull requests

2 participants