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

Update path handling to support Windows paths #57

Open
ntouran opened this issue Feb 24, 2023 · 2 comments · May be fixed by #58
Open

Update path handling to support Windows paths #57

ntouran opened this issue Feb 24, 2023 · 2 comments · May be fixed by #58

Comments

@ntouran
Copy link

ntouran commented Feb 24, 2023

I am trying out this library on Windows and have gotten into a little trouble with paths. In doing a test-report:: directive and passing a unix-style relative path for :file:

.. test-report:: Unit Test Results
   :id: REPORT
   :file: ../project/unit-test-results/project-unit-test-results.xml

I'm seeing the following rendered out:

Test file: C:Usersusernamecodesprojectdoc../project/unit-test-results/unit-test-results.xml

Template used: C:Usersusernamecodesvenvsatom39libsite-packagessphinxcontribtest_reportsdirectives/test_report_template.txt

Statistics
Test suites: 0
...

A similar problem happens when I give a windows-style relative path for :file:, including:

  • :file: ..\\..\\project\\unit-test-results\\project-unit-test-results.xml
  • :file: ..\project\unit-test-results\project-unit-test-results.xml

If this used pathlib rather than os.path I believe it might work better? Are you interested in a PR along theses lines?

@ntouran ntouran changed the title Update path handling to support Windows path Update path handling to support Windows paths Feb 24, 2023
@danwos
Copy link
Member

danwos commented Feb 24, 2023

Thanks for reporting 👍
And sure, every PR is welcome, especially as I have no access to a windows machine to test it.

ntouran added a commit to ntouran/sphinx-test-reports that referenced this issue Feb 24, 2023
@ntouran
Copy link
Author

ntouran commented Feb 27, 2023

Ok, PR #58 should work for both.

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 a pull request may close this issue.

2 participants