tysonholub: Hi, this was a fairly simple feature to implement. Wondering if it will be merged in or not. Thanks!
jairhenrique: @tysonholub please rebase this code with master.
jairhenrique: @tysonholub can you add some docs about this option?
tysonholub: All set, thanks!
jairhenrique: @tysonholub great! Can you fix this lint error: https://travis-ci.org/github/kevin1024/vcrpy/jobs/708423571

@kevin1024 can you merge this PR after CI success?
tysonholub: Woops. Fixed
codecov-commenter: # [Codecov](https://codecov.io/gh/kevin1024/vcrpy/pull/541?src=pr&el=h1) Report
> Merging [#541](https://codecov.io/gh/kevin1024/vcrpy/pull/541?src=pr&el=desc) into [master](https://codecov.io/gh/kevin1024/vcrpy/commit/6e040030b8d58ef654c429f953a73e977ff0f594&el=desc) will **increase** coverage by `0.10%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/kevin1024/vcrpy/pull/541/graphs/tree.svg?width=650&height=150&src=pr&token=YOLqUk37fb)](https://codecov.io/gh/kevin1024/vcrpy/pull/541?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #541      +/-   ##
==========================================
+ Coverage   89.01%   89.12%   +0.10%     
==========================================
  Files          24       25       +1     
  Lines        1539     1600      +61     
  Branches      212      228      +16     
==========================================
+ Hits         1370     1426      +56     
- Misses        139      140       +1     
- Partials       30       34       +4     
```


| [Impacted Files](https://codecov.io/gh/kevin1024/vcrpy/pull/541?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [vcr/cassette.py](https://codecov.io/gh/kevin1024/vcrpy/pull/541/diff?src=pr&el=tree#diff-dmNyL2Nhc3NldHRlLnB5) | `96.20% <100.00%> (+0.03%)` | :arrow_up: |
| [vcr/config.py](https://codecov.io/gh/kevin1024/vcrpy/pull/541/diff?src=pr&el=tree#diff-dmNyL2NvbmZpZy5weQ==) | `95.00% <100.00%> (+0.03%)` | :arrow_up: |
| [vcr/record\_mode.py](https://codecov.io/gh/kevin1024/vcrpy/pull/541/diff?src=pr&el=tree#diff-dmNyL3JlY29yZF9tb2RlLnB5) | `100.00% <100.00%> (ø)` | |
| [vcr/stubs/aiohttp\_stubs/\_\_init\_\_.py](https://codecov.io/gh/kevin1024/vcrpy/pull/541/diff?src=pr&el=tree#diff-dmNyL3N0dWJzL2Fpb2h0dHBfc3R1YnMvX19pbml0X18ucHk=) | | |
| [vcr/stubs/aiohttp\_stubs.py](https://codecov.io/gh/kevin1024/vcrpy/pull/541/diff?src=pr&el=tree#diff-dmNyL3N0dWJzL2Fpb2h0dHBfc3R1YnMucHk=) | `93.03% <0.00%> (ø)` | |
| [vcr/patch.py](https://codecov.io/gh/kevin1024/vcrpy/pull/541/diff?src=pr&el=tree#diff-dmNyL3BhdGNoLnB5) | `84.71% <0.00%> (+0.34%)` | :arrow_up: |
| [vcr/stubs/\_\_init\_\_.py](https://codecov.io/gh/kevin1024/vcrpy/pull/541/diff?src=pr&el=tree#diff-dmNyL3N0dWJzL19faW5pdF9fLnB5) | `93.64% <0.00%> (+2.21%)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/kevin1024/vcrpy/pull/541?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/kevin1024/vcrpy/pull/541?src=pr&el=footer). Last update [2f53776...2201f38](https://codecov.io/gh/kevin1024/vcrpy/pull/541?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).

diff --git a/docs/advanced.rst b/docs/advanced.rst
index 5536055..b16710b 100644
--- a/docs/advanced.rst
+++ b/docs/advanced.rst
@@ -33,6 +33,8 @@ consider part of the API. The fields are as follows:
    been played back.
 -  ``responses_of(request)``: Access the responses that match a given
    request
+-  ``allow_playback_repeats``: A boolean indicating whether responses
+   can be played back more than once.
 
 The ``Request`` object has the following properties:
 
@@ -386,3 +388,19 @@ VCR.py allows to rewind a cassette in order to replay it inside the same functio
         assert cass.all_played
         cass.rewind()
         assert not cass.all_played
+
+Playback Repeats
+----------------
+
+By default, each response in a cassette can only be matched and played back
+once while the cassette is in use, unless the cassette is rewound.
+
+If you want to allow playback repeats without rewinding the cassette, use
+the Cassette ``allow_playback_repeats`` option.
+
+.. code:: python
+
+    with vcr.use_cassette('fixtures/vcr_cassettes/synopsis.yaml', allow_playback_repeats=True) as cass:
+        for x in range(10):
+            response = urllib2.urlopen('http://www.zombo.com/').read()
+        assert cass.all_played
diff --git a/vcr/cassette.py b/vcr/cassette.py
index 826a68b..9122b4a 100644
--- a/vcr/cassette.py
+++ b/vcr/cassette.py
@@ -182,6 +182,7 @@ class Cassette:
         before_record_response=None,
         custom_patches=(),
         inject=False,
+        allow_playback_repeats=False,
     ):
         self._persister = persister or FilesystemPersister
         self._path = path
@@ -193,6 +194,7 @@ class Cassette:
         self.inject = inject
         self.record_mode = record_mode
         self.custom_patches = custom_patches
+        self.allow_playback_repeats = allow_playback_repeats
 
         # self.data is the list of (req, resp) tuples
         self.data = []
@@ -207,7 +209,7 @@ class Cassette:
     @property
     def all_played(self):
         """Returns True if all responses have been played, False otherwise."""
-        return self.play_count == len(self)
+        return len(self.play_counts.values()) == len(self)
 
     @property
     def requests(self):
@@ -259,7 +261,7 @@ class Cassette:
         hasn't been played back before, and mark it as played
         """
         for index, response in self._responses(request):
-            if self.play_counts[index] == 0:
+            if self.play_counts[index] == 0 or self.allow_playback_repeats:
                 self.play_counts[index] += 1
                 return response
         # The cassette doesn't contain the request asked for.
@@ -349,6 +351,6 @@ class Cassette:
     def __contains__(self, request):
         """Return whether or not a request has been stored"""
         for index, response in self._responses(request):
-            if self.play_counts[index] == 0:
+            if self.play_counts[index] == 0 or self.allow_playback_repeats:
                 return True
         return False
diff --git a/vcr/config.py b/vcr/config.py
index 7dfd1a8..e95908c 100644
--- a/vcr/config.py
+++ b/vcr/config.py
@@ -149,6 +149,7 @@ class VCR:
             "inject": kwargs.get("inject_cassette", self.inject_cassette),
             "path_transformer": path_transformer,
             "func_path_generator": func_path_generator,
+            "allow_playback_repeats": kwargs.get("allow_playback_repeats", False),
         }
         path = kwargs.get("path")
         if path:

allow_playback_repeats
Ruby VCR has a Cassette option [allow_playback_repeats](https://relishapp.com/vcr/vcr/docs/request-matching/playback-repeats). Any chance this can be added to vcrpy?
diff --git a/tests/unit/test_cassettes.py b/tests/unit/test_cassettes.py
index 90a05c7..adbc77a 100644
--- a/tests/unit/test_cassettes.py
+++ b/tests/unit/test_cassettes.py
@@ -137,6 +137,31 @@ def test_cassette_all_played():
     assert a.all_played
 
 
+@mock.patch("vcr.cassette.requests_match", _mock_requests_match)
+def test_cassette_allow_playback_repeats():
+    a = Cassette("test", allow_playback_repeats=True)
+    a.append("foo", "bar")
+    a.append("other", "resp")
+    for x in range(10):
+        assert a.play_response("foo") == "bar"
+    assert a.play_count == 10
+    assert a.all_played is False
+    assert a.play_response("other") == "resp"
+    assert a.play_count == 11
+    assert a.all_played
+
+    a.allow_playback_repeats = False
+    with pytest.raises(UnhandledHTTPRequestError) as e:
+        a.play_response("foo")
+    assert str(e.value) == "\"The cassette ('test') doesn't contain the request ('foo') asked for\""
+    a.rewind()
+    assert a.all_played is False
+    assert a.play_response("foo") == "bar"
+    assert a.all_played is False
+    assert a.play_response("other") == "resp"
+    assert a.all_played
+
+
 @mock.patch("vcr.cassette.requests_match", _mock_requests_match)
 def test_cassette_rewound():
     a = Cassette("test")

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-httpbin pytest-asyncio pytest-aiohttp pytest-tornado
apt-get update apt-get install -y libyaml-dev
3.7
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
aiohttp==3.8.6
aiosignal==1.3.1
async-timeout==4.0.3
asynctest==0.13.0
attrs==24.2.0
brotlicffi==1.1.0.0
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
charset-normalizer==3.4.1
click==8.1.8
coverage==7.2.7
decorator==5.1.1
exceptiongroup==1.2.2
flasgger==0.9.7.1
Flask==2.2.5
frozenlist==1.3.3
greenlet==2.0.2
httpbin==0.10.2
idna==3.10
importlib-metadata==6.7.0
importlib-resources==5.12.0
iniconfig==2.0.0
itsdangerous==2.1.2
Jinja2==3.1.6
jsonschema==4.17.3
MarkupSafe==2.1.5
mistune==3.0.2
multidict==6.0.5
packaging==24.0
pkgutil_resolve_name==1.3.10
pluggy==1.2.0
pycparser==2.21
pyrsistent==0.19.3
pytest==7.4.4
pytest-aiohttp==1.0.5
pytest-asyncio==0.21.2
pytest-cov==4.1.0
pytest-httpbin==2.0.0
pytest-tornado==0.8.1
PyYAML==6.0.1
six==1.17.0
tomli==2.0.1
tornado==6.2
typing_extensions==4.7.1
-e git+https://github.com/kevin1024/vcrpy.git@a249781b977ce1ae4e9a6d098a7b093dfdbeaf4a#egg=vcrpy
Werkzeug==2.2.3
wrapt==1.16.0
yarl==1.9.4
zipp==3.15.0

name: vcrpy
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - aiohttp==3.8.6
      - aiosignal==1.3.1
      - async-timeout==4.0.3
      - asynctest==0.13.0
      - attrs==24.2.0
      - brotlicffi==1.1.0.0
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - click==8.1.8
      - coverage==7.2.7
      - decorator==5.1.1
      - exceptiongroup==1.2.2
      - flasgger==0.9.7.1
      - flask==2.2.5
      - frozenlist==1.3.3
      - greenlet==2.0.2
      - httpbin==0.10.2
      - idna==3.10
      - importlib-metadata==6.7.0
      - importlib-resources==5.12.0
      - iniconfig==2.0.0
      - itsdangerous==2.1.2
      - jinja2==3.1.6
      - jsonschema==4.17.3
      - markupsafe==2.1.5
      - mistune==3.0.2
      - multidict==6.0.5
      - packaging==24.0
      - pkgutil-resolve-name==1.3.10
      - pluggy==1.2.0
      - pycparser==2.21
      - pyrsistent==0.19.3
      - pytest==7.4.4
      - pytest-aiohttp==1.0.5
      - pytest-asyncio==0.21.2
      - pytest-cov==4.1.0
      - pytest-httpbin==2.0.0
      - pytest-tornado==0.8.1
      - pyyaml==6.0.1
      - six==1.17.0
      - tomli==2.0.1
      - tornado==6.2
      - typing-extensions==4.7.1
      - vcrpy==4.0.2
      - werkzeug==2.2.3
      - wrapt==1.16.0
      - yarl==1.9.4
      - zipp==3.15.0
prefix: /opt/conda/envs/vcrpy

tests/unit/test_cassettes.py::test_cassette_allow_playback_repeats
tests/unit/test_cassettes.py::test_cassette_load tests/unit/test_cassettes.py::test_cassette_not_played tests/unit/test_cassettes.py::test_cassette_append tests/unit/test_cassettes.py::test_cassette_len tests/unit/test_cassettes.py::test_cassette_contains tests/unit/test_cassettes.py::test_cassette_responses_of tests/unit/test_cassettes.py::test_cassette_get_missing_response tests/unit/test_cassettes.py::test_cassette_cant_read_same_request_twice tests/unit/test_cassettes.py::test_function_decorated_with_use_cassette_can_be_invoked_multiple_times tests/unit/test_cassettes.py::test_arg_getter_functionality tests/unit/test_cassettes.py::test_cassette_not_all_played tests/unit/test_cassettes.py::test_cassette_all_played tests/unit/test_cassettes.py::test_cassette_rewound tests/unit/test_cassettes.py::test_before_record_response tests/unit/test_cassettes.py::test_nesting_cassette_context_managers tests/unit/test_cassettes.py::test_nesting_context_managers_by_checking_references_of_http_connection tests/unit/test_cassettes.py::test_custom_patchers tests/unit/test_cassettes.py::test_decorated_functions_are_reentrant tests/unit/test_cassettes.py::test_cassette_use_called_without_path_uses_function_to_generate_path tests/unit/test_cassettes.py::test_path_transformer_with_function_path tests/unit/test_cassettes.py::test_path_transformer_with_context_manager tests/unit/test_cassettes.py::test_path_transformer_None tests/unit/test_cassettes.py::test_func_path_generator tests/unit/test_cassettes.py::test_use_as_decorator_on_coroutine tests/unit/test_cassettes.py::test_use_as_decorator_on_generator tests/unit/test_cassettes.py::test_find_requests_with_most_matches_one_similar_request tests/unit/test_cassettes.py::test_find_requests_with_most_matches_no_similar_requests tests/unit/test_cassettes.py::test_find_requests_with_most_matches_many_similar_requests
vcr/cassette.py vcr/config.py docs/advanced.rst
vcr/cassette.py vcr/config.py docs/advanced.rst