File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed
Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -88,3 +88,4 @@ The following is a list of people who have contributed to
8888- Terence Honles (terencehonles)
8989- Paul Fisher (thetorpedodog)
9090- Julius Park (juliusgeo)
91+ - Ishmum Jawad Khan (ishmum123)
Original file line number Diff line number Diff line change @@ -827,6 +827,9 @@ def _start_retryable_write(self):
827827 self ._check_ended ()
828828 self ._server_session .inc_transaction_id ()
829829
830+ def __copy__ (self ):
831+ raise TypeError ('A ClientSession cannot be copied, create a new session instead' )
832+
830833
831834class _ServerSession (object ):
832835 def __init__ (self , generation ):
Original file line number Diff line number Diff line change @@ -779,6 +779,11 @@ def drop_db():
779779
780780 wait_until (drop_db , 'dropped database after w=0 writes' )
781781
782+ def test_session_not_copyable (self ):
783+ client = self .client
784+ with client .start_session () as s :
785+ self .assertRaises (TypeError , lambda : copy .copy (s ))
786+
782787
783788class TestCausalConsistency (unittest .TestCase ):
784789
You can’t perform that action at this time.
0 commit comments