From 2980bfccde6100f746e841070d6c203368162123 Mon Sep 17 00:00:00 2001 From: Terseus Date: Sun, 30 Oct 2022 20:18:36 +0100 Subject: [PATCH] Fix lint errors --- tests/integration/test_config.py | 12 ++++++------ vcr/cassette.py | 8 ++++---- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/tests/integration/test_config.py b/tests/integration/test_config.py index 7974260..013f849 100644 --- a/tests/integration/test_config.py +++ b/tests/integration/test_config.py @@ -65,18 +65,18 @@ def test_missing_matcher(): def test_dont_record_on_exception(tmpdir): my_vcr = vcr.VCR(record_on_exception=False) - @my_vcr.use_cassette(str(tmpdir.join('dontsave.yml'))) + @my_vcr.use_cassette(str(tmpdir.join("dontsave.yml"))) def some_test(): - assert b'Not in content' in urlopen('http://httpbin.org/get') + assert b"Not in content" in urlopen("http://httpbin.org/get") with pytest.raises(AssertionError): some_test() - assert not os.path.exists(str(tmpdir.join('dontsave.yml'))) + assert not os.path.exists(str(tmpdir.join("dontsave.yml"))) # Make sure context decorator has the same behavior with pytest.raises(AssertionError): - with my_vcr.use_cassette(str(tmpdir.join('dontsave2.yml'))): - assert b'Not in content' in urlopen('http://httpbin.org/get').read() + with my_vcr.use_cassette(str(tmpdir.join("dontsave2.yml"))): + assert b"Not in content" in urlopen("http://httpbin.org/get").read() - assert not os.path.exists(str(tmpdir.join('dontsave2.yml'))) + assert not os.path.exists(str(tmpdir.join("dontsave2.yml"))) diff --git a/vcr/cassette.py b/vcr/cassette.py index 2fe1a63..36d4e9e 100644 --- a/vcr/cassette.py +++ b/vcr/cassette.py @@ -46,7 +46,9 @@ class CassetteContextDecorator: """ _non_cassette_arguments = ( - "path_transformer", "func_path_generator", "record_on_exception", + "path_transformer", + "func_path_generator", + "record_on_exception", ) @classmethod @@ -91,9 +93,7 @@ class CassetteContextDecorator: def __exit__(self, *exc_info): exception_was_raised = any(exc_info) - record_on_exception = self._args_getter().get( - 'record_on_exception', True - ) + record_on_exception = self._args_getter().get("record_on_exception", True) if record_on_exception or not exception_was_raised: next(self.__finish, None) self.__finish = None