We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cacde44 commit 5aa514cCopy full SHA for 5aa514c
tests/test_zenodo.py
@@ -65,13 +65,10 @@ def test_get_metadata_and_archive_url_failure(monkeypatch):
65
record._get_metadata_and_archive_url()
66
67
68
-def test_get_metadata_and_archive_url_connection_error(monkeypatch):
69
- monkeypatch.setattr(
70
- "requests.get",
71
- lambda *args, **kwargs: (_ for _ in ()).throw(
72
- requests.exceptions.RequestException("Connection error")
73
- ),
74
- )
+@patch(
+ "requests.get", side_effect=requests.exceptions.RequestException("Connection error")
+)
+def test_get_metadata_and_archive_url_connection_error(mock_get):
75
record = ZenodoRecord("123", Path("/tmp"), "test")
76
77
assert record._get_metadata_and_archive_url() is None
0 commit comments