Skip to content

Commit

Permalink
add doctest to travis.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
mpenkov committed Jan 8, 2020
1 parent 8a723f7 commit 7a37f32
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ script:
fi
- pip install numpy
- py.test integration-tests/test_207.py
- python -m doctest README.rst
- python -m doctest howto.md


cache:
Expand Down
18 changes: 9 additions & 9 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -132,15 +132,15 @@ More examples

.. code-block:: python
>>> import boto3
>>>
>>> # stream content *into* S3 (write mode) using a custom session
>>> url = 's3://smart-open-py37-benchmark-results/test.txt'
>>> lines = [b'first line\n', b'second line\n', b'third line\n']
>>> transport_params = {'session': boto3.Session(profile_name='smart_open')}
>>> with open(url, 'wb', transport_params=transport_params) as fout:
... for line in lines:
... bytes_written = fout.write(line)
import boto3
# stream content *into* S3 (write mode) using a custom session
url = 's3://smart-open-py37-benchmark-results/test.txt'
lines = [b'first line\n', b'second line\n', b'third line\n']
transport_params = {'session': boto3.Session(profile_name='smart_open')}
with open(url, 'wb', transport_params=transport_params) as fout:
for line in lines:
bytes_written = fout.write(line)
.. code-block:: python
Expand Down

0 comments on commit 7a37f32

Please sign in to comment.