@@ -530,13 +530,6 @@ def test_method(self):
530
530
with pytest .raises (ValueError ):
531
531
Context (10 )
532
532
533
- @skip_if_py3
534
- def test_method_long (self ):
535
- """
536
- On Python 2 `Context` accepts values of type `long` as well as `int`.
537
- """
538
- Context (long (TLSv1_METHOD ))
539
-
540
533
def test_type (self ):
541
534
"""
542
535
`Context` can be used to create instances of that type.
@@ -609,14 +602,6 @@ def test_use_privatekey_file_unicode(self, tmpfile):
609
602
FILETYPE_PEM ,
610
603
)
611
604
612
- @skip_if_py3
613
- def test_use_privatekey_file_long (self , tmpfile ):
614
- """
615
- On Python 2 `Context.use_privatekey_file` accepts a filetype of
616
- type `long` as well as `int`.
617
- """
618
- self ._use_privatekey_file_test (tmpfile , long (FILETYPE_PEM ))
619
-
620
605
def test_use_certificate_wrong_args (self ):
621
606
"""
622
607
`Context.use_certificate_wrong_args` raises `TypeError` when not passed
@@ -705,19 +690,6 @@ def test_use_certificate_file_unicode(self, tmpfile):
705
690
filename = tmpfile .decode (getfilesystemencoding ()) + NON_ASCII
706
691
self ._use_certificate_file_test (filename )
707
692
708
- @skip_if_py3
709
- def test_use_certificate_file_long (self , tmpfile ):
710
- """
711
- On Python 2 `Context.use_certificate_file` accepts a
712
- filetype of type `long` as well as `int`.
713
- """
714
- pem_filename = tmpfile
715
- with open (pem_filename , "wb" ) as pem_file :
716
- pem_file .write (cleartextCertificatePEM )
717
-
718
- ctx = Context (TLSv1_METHOD )
719
- ctx .use_certificate_file (pem_filename , long (FILETYPE_PEM ))
720
-
721
693
def test_check_privatekey_valid (self ):
722
694
"""
723
695
`Context.check_privatekey` returns `None` if the `Context` instance
@@ -771,16 +743,6 @@ def test_set_options(self):
771
743
options = context .set_options (OP_NO_SSLv2 )
772
744
assert options & OP_NO_SSLv2 == OP_NO_SSLv2
773
745
774
- @skip_if_py3
775
- def test_set_options_long (self ):
776
- """
777
- On Python 2 `Context.set_options` accepts values of type
778
- `long` as well as `int`.
779
- """
780
- context = Context (TLSv1_METHOD )
781
- options = context .set_options (long (OP_NO_SSLv2 ))
782
- assert options & OP_NO_SSLv2 == OP_NO_SSLv2
783
-
784
746
def test_set_mode_wrong_args (self ):
785
747
"""
786
748
`Context.set_mode` raises `TypeError` if called with
@@ -798,16 +760,6 @@ def test_set_mode(self):
798
760
context = Context (TLSv1_METHOD )
799
761
assert MODE_RELEASE_BUFFERS & context .set_mode (MODE_RELEASE_BUFFERS )
800
762
801
- @skip_if_py3
802
- def test_set_mode_long (self ):
803
- """
804
- On Python 2 `Context.set_mode` accepts values of type `long` as well
805
- as `int`.
806
- """
807
- context = Context (TLSv1_METHOD )
808
- mode = context .set_mode (long (MODE_RELEASE_BUFFERS ))
809
- assert MODE_RELEASE_BUFFERS & mode
810
-
811
763
def test_set_timeout_wrong_args (self ):
812
764
"""
813
765
`Context.set_timeout` raises `TypeError` if called with
@@ -827,16 +779,6 @@ def test_timeout(self):
827
779
context .set_timeout (1234 )
828
780
assert context .get_timeout () == 1234
829
781
830
- @skip_if_py3
831
- def test_timeout_long (self ):
832
- """
833
- On Python 2 `Context.set_timeout` accepts values of type `long` as
834
- well as int.
835
- """
836
- context = Context (TLSv1_METHOD )
837
- context .set_timeout (long (1234 ))
838
- assert context .get_timeout () == 1234
839
-
840
782
def test_set_verify_depth_wrong_args (self ):
841
783
"""
842
784
`Context.set_verify_depth` raises `TypeError` if called with a
@@ -856,16 +798,6 @@ def test_verify_depth(self):
856
798
context .set_verify_depth (11 )
857
799
assert context .get_verify_depth () == 11
858
800
859
- @skip_if_py3
860
- def test_verify_depth_long (self ):
861
- """
862
- On Python 2 `Context.set_verify_depth` accepts values of type `long`
863
- as well as int.
864
- """
865
- context = Context (TLSv1_METHOD )
866
- context .set_verify_depth (long (11 ))
867
- assert context .get_verify_depth () == 11
868
-
869
801
def _write_encrypted_pem (self , passphrase , tmpfile ):
870
802
"""
871
803
Write a new private key out to a new file, encrypted using the given
@@ -1486,19 +1418,6 @@ def test_set_verify_mode(self):
1486
1418
VERIFY_PEER | VERIFY_CLIENT_ONCE , lambda * args : None )
1487
1419
assert context .get_verify_mode () == (VERIFY_PEER | VERIFY_CLIENT_ONCE )
1488
1420
1489
- @skip_if_py3
1490
- def test_set_verify_mode_long (self ):
1491
- """
1492
- On Python 2 `Context.set_verify_mode` accepts values of type `long`
1493
- as well as `int`.
1494
- """
1495
- context = Context (TLSv1_METHOD )
1496
- assert context .get_verify_mode () == 0
1497
- context .set_verify (
1498
- long (VERIFY_PEER | VERIFY_CLIENT_ONCE ), lambda * args : None
1499
- ) # pragma: nocover
1500
- assert context .get_verify_mode () == (VERIFY_PEER | VERIFY_CLIENT_ONCE )
1501
-
1502
1421
@pytest .mark .parametrize ('mode' , [None , 1.0 , object (), 'mode' ])
1503
1422
def test_set_verify_wrong_mode_arg (self , mode ):
1504
1423
"""
@@ -1604,16 +1523,6 @@ def test_session_cache_mode(self):
1604
1523
assert SESS_CACHE_OFF == off
1605
1524
assert SESS_CACHE_BOTH == context .get_session_cache_mode ()
1606
1525
1607
- @skip_if_py3
1608
- def test_session_cache_mode_long (self ):
1609
- """
1610
- On Python 2 `Context.set_session_cache_mode` accepts values
1611
- of type `long` as well as `int`.
1612
- """
1613
- context = Context (TLSv1_METHOD )
1614
- context .set_session_cache_mode (long (SESS_CACHE_BOTH ))
1615
- assert SESS_CACHE_BOTH == context .get_session_cache_mode ()
1616
-
1617
1526
def test_get_cert_store (self ):
1618
1527
"""
1619
1528
`Context.get_cert_store` returns a `X509Store` instance.
@@ -2401,16 +2310,6 @@ def test_set_shutdown(self):
2401
2310
connection .set_shutdown (RECEIVED_SHUTDOWN )
2402
2311
assert connection .get_shutdown () == RECEIVED_SHUTDOWN
2403
2312
2404
- @skip_if_py3
2405
- def test_set_shutdown_long (self ):
2406
- """
2407
- On Python 2 `Connection.set_shutdown` accepts an argument
2408
- of type `long` as well as `int`.
2409
- """
2410
- connection = Connection (Context (TLSv1_METHOD ), socket_any_family ())
2411
- connection .set_shutdown (long (RECEIVED_SHUTDOWN ))
2412
- assert connection .get_shutdown () == RECEIVED_SHUTDOWN
2413
-
2414
2313
def test_state_string (self ):
2415
2314
"""
2416
2315
`Connection.state_string` verbosely describes the current state of
@@ -2868,22 +2767,6 @@ def test_buffer_size(self):
2868
2767
data = conn .bio_read (2 )
2869
2768
assert 2 == len (data )
2870
2769
2871
- @skip_if_py3
2872
- def test_buffer_size_long (self ):
2873
- """
2874
- On Python 2 `Connection.bio_read` accepts values of type `long` as
2875
- well as `int`.
2876
- """
2877
- ctx = Context (TLSv1_METHOD )
2878
- conn = Connection (ctx , None )
2879
- conn .set_connect_state ()
2880
- try :
2881
- conn .do_handshake ()
2882
- except WantReadError :
2883
- pass
2884
- data = conn .bio_read (long (2 ))
2885
- assert 2 == len (data )
2886
-
2887
2770
2888
2771
class TestConnectionGetCipherList (object ):
2889
2772
"""
0 commit comments