-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Add PathComparer for testing and fix 2 test failure on Windows. #5943
Conversation
@@ -47,3 +48,7 @@ def _initialize_test_directory(session): | |||
|
|||
def pytest_sessionstart(session): | |||
_initialize_test_directory(session) | |||
|
|||
|
|||
def pytest_assertrepr_compare(op, left, right): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom reporting hook for pytest
https://docs.pytest.org/en/latest/assert.html#defining-your-own-assertion-comparison
|
||
|
||
def pytest_assertrepr_compare(op, left, right): | ||
comparer.pytest_assertrepr_compare(op, left, right) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If testing is failed, pytest runner emit this output:
_______________________________ test_compare _______________________________
> assert project.path2doc('/path/to/index.rst') == PathComparer('/path/to/index2')
E assert Comparing path:
- C:/path/to/index
+ C:/path/to/index2
? +
Codecov Report
@@ Coverage Diff @@
## master #5943 +/- ##
==========================================
- Coverage 82.9% 82.88% -0.03%
==========================================
Files 293 294 +1
Lines 39536 39576 +40
Branches 5903 5909 +6
==========================================
+ Hits 32777 32801 +24
- Misses 5396 5411 +15
- Partials 1363 1364 +1
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1267595
to
ef9a5ad
Compare
Feature or Bugfix
Purpose