Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Ensure demo example works without error #49

Merged
merged 9 commits into from
Nov 14, 2023

Conversation

GenevieveBuckley
Copy link
Contributor

Closes #48

Copy link
Owner

@12rambau 12rambau left a comment

Choose a reason for hiding this comment

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

Thank you very much for your PRs !

Could you sync your fork with the current main as it includes modifications that you suggested in other PR ?

I made small comments

@GenevieveBuckley
Copy link
Contributor Author

I'm not entirely sure how to handle all the assert result.project_dir.name == statements scattered through usage.rst.

Since this isn't what actually happens when you run pytest-copie, we should change them. result.project_dir is generally the temp pytest folder, named something like copie0001, copie0002, etc. which doesn't give us a meaningful name attribute.

I count 4 places where this is written in the docs:

  1. https://github.com/12rambau/pytest-copie/blame/c9f5e3f435c8d56fefb969814102345d051540e2/README.rst#L77
  2. https://github.com/12rambau/pytest-copie/blame/c9f5e3f435c8d56fefb969814102345d051540e2/docs/usage.rst#L49
  3. https://github.com/12rambau/pytest-copie/blame/c9f5e3f435c8d56fefb969814102345d051540e2/docs/usage.rst#L79
  4. https://github.com/12rambau/pytest-copie/blame/c9f5e3f435c8d56fefb969814102345d051540e2/docs/usage.rst#L111

For (2) and (3) I can do this, because we have prior knowledge about what the contents of the README.rst.jinja file is supposed to be:

assert result.project_dir.is_dir()
with open(result.project_dir/"README.rst") as f:
    assert f.readline() == "foobar\n"  # or "helloworld\n"

For (1), we don't have any prior knowledge of the template contents, so we can't do this. It might be best to just remove that line. That might not be a great solution, but it is better than keeping the inaccurate info.

For (4), I'm not sure. I haven't used custom templates yet. I'll have to try it out and see what happens.

Copy link

codecov bot commented Nov 1, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (c9f5e3f) 98.59% compared to head (532f736) 96.00%.
Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main      #49      +/-   ##
==========================================
- Coverage   98.59%   96.00%   -2.60%     
==========================================
  Files           2        2              
  Lines          71       75       +4     
==========================================
+ Hits           70       72       +2     
- Misses          1        3       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@GenevieveBuckley
Copy link
Contributor Author

Nice catch - I totally assumed I was appending to that file instead of overwriting it, thank you! I think it should be fixed now.

Copy link
Owner

@12rambau 12rambau left a comment

Choose a reason for hiding this comment

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

Sorry for the long review time, my comments were on stale for 2 weeks. the checks are passing so I'll merge this one. Thanks for your contribution !

@12rambau 12rambau merged commit d381d66 into 12rambau:main Nov 14, 2023
@GenevieveBuckley GenevieveBuckley deleted the fix-usage-example branch November 15, 2023 23:10
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Usage docs page example does not work correctly
2 participants