diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..a75882dd --- /dev/null +++ b/.travis.yml @@ -0,0 +1,23 @@ +sudo: false + +addons: + apt: + packages: + - dos2unix + +language: python + +python: + - "2.6" + - "2.7" + - "3.2" + - "3.3" + - "3.4" + - "3.5" + + +install: + - dos2unix README.txt + - pip install . + +script: python shapefile.py diff --git a/README.txt b/README.txt index df8014f5..ffbe4c3e 100644 --- a/README.txt +++ b/README.txt @@ -296,8 +296,9 @@ The blockgroup key and population count: There is also an iterShapeRecords() method to iterate through large files: >>> shapeRecs = sf.iterShapeRecords() ->>> for shape, rec in shapeRecs: +>>> for shapeRec in shapeRecs: ... # do something here +... pass Writing Shapefiles ++++++++++++++++++ diff --git a/shapefile.py b/shapefile.py index c125a909..415e6482 100644 --- a/shapefile.py +++ b/shapefile.py @@ -1183,7 +1183,8 @@ def __fieldNorm(self, fieldName): def test(): import doctest doctest.NORMALIZE_WHITESPACE = 1 - doctest.testfile("README.txt", verbose=1) + failure_count, test_count = doctest.testfile("README.txt", verbose=1) + return failure_count if __name__ == "__main__": """ @@ -1192,4 +1193,6 @@ def test(): testing libraries but for now unit testing is done using what's available in 2.3. """ - test() + failure_count = test() + sys.exit(failure_count) +