Skip to content
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

Reformat code block as markdown literal code, so doctest skips it. Fixes #264 #265

Merged

Conversation

JamesParrott
Copy link
Collaborator

The code block causing the doctests to fail is a helpful example for users, but the whole point of it is to use a variable name, which is not defined in the snippet.

This PR simply removes the >>>s so doctest skips it.

Alternatively, this variable (filename) could be defined in the code block. But then the text of the readme would need to be rewritten to reflect this.

If it is desirable to keep this test, it could easily be added to the pytest tests in test_shapefile.py, at the cost of duplication.

@JamesParrott
Copy link
Collaborator Author

Local test session:

C:\tmp2>git clone --depth=1 --branch PyShp-fix-doctest https://github.com/JamesParrott/IronPyShp .
Cloning into '.'...
remote: Enumerating objects: 80, done.
remote: Counting objects: 100% (80/80), done.
remote: Compressing objects: 100% (73/73), done.
remote: Total 80 (delta 17), reused 46 (delta 4), pack-reused 0
Receiving objects: 100% (80/80), 2.02 MiB | 486.00 KiB/s, done.
Resolving deltas: 100% (17/17), done.

C:\tmp2>python --version
Python 3.12.1

C:\tmp2>python shapefile.py
Running doctests...
All test passed successfully

C:\tmp2>c:\Python27\python.exe --version
Python 2.7.18

C:\tmp2>c:\Python27\python.exe shapefile.py
Running doctests...
All test passed successfully

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants