Skip to content
Myr

Merge pull request #4710 from Stevoisiak/remove-unused-sessions

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Remove unused session variables

authored by Nate Prewitt · committed by GitHub · parents 943a5c8, 28da72b · Browse files · 1 file+0 added−6 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−6 removed

  • tests:+0 added−6 removed

1 file+0 added−6 removed

modified:tests/test_requests.py-6 removed
1603 unmodified lines
1604 assert not r3.is_redirect16051606 def test_prepare_body_position_non_stream(self):1607 data = b'the data'1608 s = requests.Session()1608 prep = requests.Request('GET', 'http://example.com', data=data).prepare()1609 assert prep._body_position is None16101611 def test_rewind_body(self):1612 data = io.BytesIO(b'the data')1614 s = requests.Session()1613 prep = requests.Request('GET', 'http://example.com', data=data).prepare()1614 assert prep._body_position == 01615 assert prep.body.read() == b'the data'1616
5 unmodified lines
1622 assert prep.body.read() == b'the data'16231624 def test_rewind_partially_read_body(self):1625 data = io.BytesIO(b'the data')1628 s = requests.Session()1626 data.read(4) # read some data1627 prep = requests.Request('GET', 'http://example.com', data=data).prepare()1628 assert prep._body_position == 41629 assert prep.body.read() == b'data'
16 unmodified lines
1646 def __iter__(self):1647 return16481649 data = BadFileObj('the data')1653 s = requests.Session()1650 prep = requests.Request('GET', 'http://example.com', data=data).prepare()1651 assert prep._body_position == 016521653 with pytest.raises(UnrewindableBodyError) as e:
15 unmodified lines
1669 def __iter__(self):1670 return16711672 data = BadFileObj('the data')1677 s = requests.Session()1673 prep = requests.Request('GET', 'http://example.com', data=data).prepare()1674 assert prep._body_position == 016751676 with pytest.raises(UnrewindableBodyError) as e:
12 unmodified lines
1689 def __iter__(self):1690 return16911692 data = BadFileObj('the data')1698 s = requests.Session()1693 prep = requests.Request('GET', 'http://example.com', data=data).prepare()1694 assert prep._body_position is not None16951696 with pytest.raises(UnrewindableBodyError) as e:
774 unmodified lines