Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- tests\integration\models\test_inbox.py:51 (TestInbox.test_mark_unread)
- self = <tests.integration.models.test_inbox.TestInbox object at 0x0000024C4DC9FCA0>
- request = <SubRequest 'cassette' for <Function test_mark_unread>>
- recorder = <betamax.recorder.Betamax object at 0x0000024C4EDAEA00>
- cassette_name = 'TestInbox.test_mark_unread'
- @pytest.fixture(autouse=True)
- def cassette(self, request, recorder, cassette_name):
- """Wrap a test in a Betamax cassette."""
- global used_cassettes
- kwargs = {}
- for marker in request.node.iter_markers("add_placeholder"):
- for key, value in marker.kwargs.items():
- recorder.config.default_cassette_options["placeholders"].append(
- {"placeholder": f"<{key.upper()}>", "replace": value}
- )
- for marker in request.node.iter_markers("recorder_kwargs"):
- for key, value in marker.kwargs.items():
- # Don't overwrite existing values since function markers are provided
- # before class markers.
- kwargs.setdefault(key, value)
- with recorder.use_cassette(cassette_name, **kwargs) as recorder:
- cassette = recorder.current_cassette
- if cassette.is_recording():
- ensure_environment_variables()
- yield recorder
- > ensure_integration_test(cassette)
- tests\integration\__init__.py:60:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- cassette = <betamax.cassette.cassette.Cassette object at 0x0000024C4EDAE130>
- def ensure_integration_test(cassette):
- if cassette.is_recording():
- is_integration_test = not cassette.is_empty()
- action = "record"
- else:
- is_integration_test = any(
- interaction.used for interaction in cassette.interactions
- )
- action = "play back"
- message = f"Cassette did not {action} any requests. This test can be a unit test."
- > assert is_integration_test, message
- E AssertionError: Cassette did not play back any requests. This test can be a unit test.
- tests\utils.py:42: AssertionError
Advertisement
Add Comment
Please, Sign In to add comment