-
Notifications
You must be signed in to change notification settings - Fork 477
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1116: Harmonize most doctests with Pint's current behavior r=hgrecco a=clarkgwillison - [ ] Closes # (no single issue) - [x] Executed ``black -t py36 . && isort -rc . && flake8`` with no errors - [x] The change is fully covered by automated unit tests - [x] Documented in docs/ as appropriate - [x] Added an entry to the CHANGES file This PR partially addresses #947, #972, and #990 After merging, the number of failing doctests in the Sphinx documentation should go from 92 (as mentioned in #947) down to 3: ``` Doctest summary =============== 335 tests 3 failures in tests 0 failures in setup code 0 failures in cleanup code build finished with problems. make: *** [doctest] Error 1 ``` Which will put us well in reach of enabling doctests in Travis to prevent documentation regressions in the future. Most tests were fixed in this PR by deferring to the current behavior of Pint, however `Quantity.__repr__()` was modified to round floating point magnitudes to 9 digits to avoid several test failures that were being caused by floating point ambiguities. Issue #1115 was opened to track the 3 tests that I could not easily resolve. Once that issue is resolved, we can enable doctests in Travis without breaking CI. Co-authored-by: Clark Willison <[email protected]>
- Loading branch information
Showing
18 changed files
with
235 additions
and
146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,6 +32,38 @@ Pint uses `bors-ng` as a merge bot and therefore every PR is tested before mergi | |
In any case, feel free to use the `issue tracker`_ to discuss ideas for new features or improvements. | ||
|
||
|
||
Setting up your environment | ||
--------------------------- | ||
|
||
If you're contributing to this project for the fist time, you can set up your | ||
environment on Linux or OSX with the following commands:: | ||
|
||
$ git clone [email protected]:hgrecco/pint.git | ||
$ cd pint | ||
$ python -m virtualenv venv | ||
$ source venv/bin/activate | ||
$ pip install -e . | ||
$ pip install -r requirements_docs.txt | ||
|
||
Running tests and building documentation | ||
---------------------------------------- | ||
|
||
To run the test suite, invoke pytest from the ``pint`` directory:: | ||
|
||
$ cd pint | ||
$ pytest | ||
|
||
To run the doctests, invoke Sphinx's doctest module from the ``docs`` directory:: | ||
|
||
$ cd docs | ||
$ make doctest | ||
|
||
To build the documentation, invoke Sphinx from the ``docs`` directory:: | ||
|
||
$ cd docs | ||
$ make html | ||
|
||
|
||
.. _github: http://github.com/hgrecco/pint | ||
.. _`issue tracker`: https://github.com/hgrecco/pint/issues | ||
.. _`bors-ng`: https://github.com/bors-ng/bors-ng | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,4 +111,4 @@ Pint | |
:members: | ||
|
||
.. automodule:: pint.testsuite.test_util | ||
:members: | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.