File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -108,7 +108,8 @@ def test_decodes_valid_jwt(self):
108108 @unittest .skipIf (not has_crypto , "Can't run without cryptography library" )
109109 def test_decodes_valid_es384_jwt (self ):
110110 example_payload = {'hello' : 'world' }
111- example_pubkey = open ('tests/testkey_ec.pub' , 'r' ).read ()
111+ with open ('tests/testkey_ec.pub' , 'r' ) as fp :
112+ example_pubkey = fp .read ()
112113 example_jwt = (
113114 b'eyJhbGciOiJFUzM4NCIsInR5cCI6IkpXVCJ9'
114115 b'.eyJoZWxsbyI6IndvcmxkIn0'
@@ -128,7 +129,8 @@ def test_decodes_valid_es384_jwt(self):
128129 @unittest .skipIf (not has_crypto , "Can't run without cryptography library" )
129130 def test_decodes_valid_rs384_jwt (self ):
130131 example_payload = {'hello' : 'world' }
131- example_pubkey = open ('tests/testkey_rsa.pub' , 'r' ).read ()
132+ with open ('tests/testkey_rsa.pub' , 'r' ) as fp :
133+ example_pubkey = fp .read ()
132134 example_jwt = (
133135 b'eyJhbGciOiJSUzM4NCIsInR5cCI6IkpXVCJ9'
134136 b'.eyJoZWxsbyI6IndvcmxkIn0'
You can’t perform that action at this time.
0 commit comments