Skip to content

Add Travis testing. #69

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 29, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,17 @@
language: python

python:
- '2.7'
- '2.7'
- '3.3'
- '3.4'
- '3.5'

install:
- pip install .

script:
- touch foo
- python shapefile.py

deploy:
provider: pypi
user: jlawhead
Expand Down
11 changes: 7 additions & 4 deletions shapefile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1190,16 +1190,19 @@ def __fieldNorm(self, fieldName):
fieldName.replace(' ', '_')

# Begin Testing
def test():
def test(**kwargs):
import doctest
doctest.NORMALIZE_WHITESPACE = 1
doctest.testfile("README.md", verbose=1)

verbosity = kwargs.get('verbose', 1)
failure_count, test_count = doctest.testfile("README.md", verbose=verbosity)
return failure_count

if __name__ == "__main__":
"""
Doctests are contained in the file 'README.md'. This library was originally developed
using Python 2.3. Python 2.4 and above have some excellent improvements in the built-in
testing libraries but for now unit testing is done using what's available in
2.3.
"""
test()
failure_count = test()
sys.exit(failure_count)