8000 DOC: Use doctest-skip for datasource examples which assume files exist · numpy/numpy@e7cf136 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7cf136

Browse files
sebergbsipocz
authored andcommitted
DOC: Use doctest-skip for datasource examples which assume files exist
1 parent 62b6170 commit e7cf136

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

numpy/lib/_datasource.py

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@
1717
DataSource files can also be compressed or uncompressed. Currently only
1818
gzip, bz2 and xz are supported.
1919
20-
Example::
20+
Example
21+
22+
.. doctest-skip::
2123
2224
>>> # Create a DataSource, use os.curdir (default) for local storage.
2325
>>> from numpy import DataSource
@@ -216,7 +218,9 @@ class DataSource:
216218
Notes
217219
-----
218220
URLs require a scheme string (``http://``) to be used, without it they
219-
will fail::
221+
will fail:
222+
223+
.. doctest-skip::
220224
221225
>>> repos = np.lib.npyio.DataSource()
222226
>>> repos.exists('www.google.com/index.html')
@@ -228,7 +232,7 @@ class DataSource:
228232
229233
Examples
230234
--------
231-
::
235+
.. doctest-skip::
232236
233237
>>> ds = np.lib.npyio.DataSource('/home/guido')
234238
>>> urlname = 'http://www.google.com/'
@@ -560,15 +564,19 @@ class Repository (DataSource):
560564
Examples
561565
--------
562566
To analyze all files in the repository, do something like this
563-
(note: this is not self-contained code)::
567+
(note: this is not self-contained code):
568+
569+
.. doctest-skip::
564570
565571
>>> repos = np.lib._datasource.Repository('/home/user/data/dir/')
566572
>>> for filename in filelist:
567573
... fp = repos.open(filename)
568574
... fp.analyze()
569575
... fp.close()
570576
571-
Similarly you could use a URL for a repository::
577+
Similarly you could use a URL for a repository:
578+
579+
.. doctest-skip::
572580
573581
>>> repos = np.lib._datasource.Repository('http://www.xyz.edu/data')
574582

0 commit comments

Comments
 (0)
0