Easily open or delete vcrpy cassettes within your tests. Bulk delete cassettes from the current file or the entire workspace.
- CodeLens buttons above vcr decorators to open or delete cassettes
- Commands:
- Delete Cassettes in Current File
- Delete Cassettes in Workspace
- Python language mode must be selected for the active file.
- Only scans for cassettes in files that start with
test_
. (can be changed withtestFileNameStartsWith
setting) - Cassette names must match their function name.
- Only yaml cassettes are supported.
Deletes all cassettes in the current file. Asks for confirmation before deleting.
Deletes all cassettes in the current workspace. Asks for confirmation before deleting.
vcrpy-cassette-mgr.testFileNameStartsWith
: The prefix of your test files. This is used to determine which files are test files and which are not. Defaults totest_
.vcrpy-cassette-mgr.cassetteDirectoryName
: The name of the directory where your cassettes are stored. The directory will be automatically located in any subdirectories of your workspace. Defaults tocassettes
.vcrpy-cassette-mgr.vcrDecoratorMatchText
: The text that should be matched to determine if a line is a vcrpy decorator. The default is for pytest, but can be changed to match any decorator such as@vcr.use_cassette
. Defaults to@pytest.mark.vcr
.vcrpy-cassette-mgr.deleteConfirmation
: Choose when to confirm before deleting cassettes.. Defaults toWorkspace, Current File, Tests
.vcrpy-cassette-mgr.cassetteButtonOpen
: Show a button in the editor to open the cassette file. Defaults totrue
.vcrpy-cassette-mgr.cassetteButtonDelete
: Show a button in the editor to delete the cassette file. Defaults totrue
.
- Add the ability to detect vcr record mode (from pytest config or
python.testing.pytestArgs
vs code setting override) and change it from the status bar. - Add the ability to detect cassette folder (from pytest config).
None at this time.
- Fixed multiple cassettes found when tests have same base name #2
Added planned features section to README.
- Fixed missing cassettes when
@pytest.mark.parametrize
decorator is used #1
- New configuration options:
vcrpy-cassette-mgr.deleteConfirmation
vcrpy-cassette-mgr.cassetteButtonOpen
vcrpy-cassette-mgr.cassetteButtonDelete
- Status bar:
- Shows the number of cassettes in the current file
- Warns if the cassette directory is not found
- Provides quick access to delete commands, rescan directory, and configure extension
- CodeLens buttons above vcr decorators to open or delete cassettes
- Commands:
- Delete Cassettes in Current File
- Delete Cassettes in Workspace