]> khamidou — GitHub mirrors - vcrpy.git/commitdiff
fix with_current_defaults causing TypeError
authorSam Stavinoha <smlstvnh@gmail.com>
Wed, 1 Apr 2015 02:05:12 +0000 (21:05 -0500)
committerSam Stavinoha <smlstvnh@gmail.com>
Wed, 1 Apr 2015 02:08:26 +0000 (21:08 -0500)
The from_args() method in cassette.py was
throwing a TypeError when calling

    use_cassette(..., with_current_defaults=True)
    ...
    TypeError: from_args() takes exactly 3 arguments (4 given)

The path was then being passed to use() twice.

vcr/config.py

index 47f7540ee0992e53ee03b683d6c87e3bc0e31be9..5cf82b9ae310713d2bed4b278dae40c05996534c 100644 (file)
@@ -69,7 +69,8 @@ class VCR(object):
 
     def use_cassette(self, path, with_current_defaults=False, **kwargs):
         if with_current_defaults:
-            return Cassette.use(path, self.get_path_and_merged_config(path, **kwargs))
+            path, config = self.get_path_and_merged_config(path, **kwargs)
+            return Cassette.use(path, **config)
         # This is made a function that evaluates every time a cassette is made so that
         # changes that are made to this VCR instance that occur AFTER the use_cassette
         # decorator is applied still affect subsequent calls to the decorated function.