Skip to content

Commit afaf90e

Browse files
Micah CochranMicah Cochran
authored andcommitted
Merge pull request #43 from micahcochran/add-travis
* Incorporates rebased #43 * Closes #43 * Add Travis-CI, remove one doctest "... # do something here" throws off doctest in Python 2.7, removed a > to make that one not a doctest. Added .travis.yml for Travis-CI. I'm expecting Python 3.x tests to fail. * on success test return 0, on failure return the number of failed tests * added sys.exit() for return code * convert README.txt from dos to unix format, see if it helps doctest
1 parent c593c15 commit afaf90e

File tree

3 files changed

+31
-5
lines changed

3 files changed

+31
-5
lines changed

.travis.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
sudo: false
2+
3+
addons:
4+
apt:
5+
packages:
6+
- dos2unix
7+
8+
language: python
9+
10+
python:
11+
- "2.6"
12+
- "2.7"
13+
- "3.2"
14+
- "3.3"
15+
- "3.4"
16+
- "3.5"
17+
18+
19+
install:
20+
- dos2unix README.txt
21+
- pip install .
22+
23+
script: python shapefile.py

README.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -295,9 +295,9 @@ The blockgroup key and population count:
295295

296296
There is also an iterShapeRecords() method to iterate through large files:
297297

298-
>>> shapeRecs = sf.iterShapeRecords()
299-
>>> for shape, rec in shapeRecs:
300-
... # do something here
298+
>> shapeRecs = sf.iterShapeRecords()
299+
>> for shape, rec in shapeRecs:
300+
.. # do something here
301301

302302
Writing Shapefiles
303303
++++++++++++++++++

shapefile.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1190,7 +1190,8 @@ def __fieldNorm(self, fieldName):
11901190
def test():
11911191
import doctest
11921192
doctest.NORMALIZE_WHITESPACE = 1
1193-
doctest.testfile("README.txt", verbose=1)
1193+
failure_count, test_count = doctest.testfile("README.txt", verbose=1)
1194+
return failure_count
11941195

11951196
if __name__ == "__main__":
11961197
"""
@@ -1199,4 +1200,6 @@ def test():
11991200
testing libraries but for now unit testing is done using what's available in
12001201
2.3.
12011202
"""
1202-
test()
1203+
failure_count = test()
1204+
sys.exit(failure_count)
1205+

0 commit comments

Comments
 (0)