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

Add PathComparer for testing and fix 2 test failure on Windows. #5943

Merged
merged 4 commits into from
Jan 13, 2019

Conversation

shimizukawa
Copy link
Member

Feature or Bugfix

  • Bugfix for testing on Windows

Purpose

  • Introduce os-independent path comparer that helps testing

@@ -47,3 +48,7 @@ def _initialize_test_directory(session):

def pytest_sessionstart(session):
_initialize_test_directory(session)


def pytest_assertrepr_compare(op, left, right):
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.



def pytest_assertrepr_compare(op, left, right):
comparer.pytest_assertrepr_compare(op, left, right)
Copy link
Member Author

@shimizukawa shimizukawa Jan 13, 2019

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
Copy link

codecov bot commented Jan 13, 2019

Codecov Report

Merging #5943 into master will decrease coverage by 0.02%.
The diff coverage is 60%.

Impacted file tree graph

@@            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
Impacted Files Coverage Δ
tests/test_environment.py 100% <100%> (ø) ⬆️
tests/test_project.py 100% <100%> (ø) ⬆️
sphinx/testing/comparer.py 51.61% <51.61%> (ø)
tests/conftest.py 88% <66.66%> (-2.91%) ⬇️
tests/test_util_pycompat.py 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6981f41...d70beb5. Read the comment docs.

Copy link
Member

@tk0miya tk0miya left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@shimizukawa shimizukawa force-pushed the pathlib-for-path-comparing-testing branch from 1267595 to ef9a5ad Compare January 13, 2019 09:10
@shimizukawa shimizukawa merged commit 795b518 into master Jan 13, 2019
@shimizukawa shimizukawa deleted the pathlib-for-path-comparing-testing branch January 13, 2019 09:40
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants