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

Fix test_generators.py for correct pointing to test file. #3378

Open
1 task done
egberts opened this issue Jul 23, 2024 · 0 comments
Open
1 task done

Fix test_generators.py for correct pointing to test file. #3378

egberts opened this issue Jul 23, 2024 · 0 comments
Labels

Comments

@egberts
Copy link
Contributor

egberts commented Jul 23, 2024

  • [x ] I have read the Filing Issues and subsequent “How to Get Help” sections of the documentation.
  • I have searched the issues (including closed ones) and believe that this is not a duplicate.

Issue

Test test_static_and_attach_links_on_generated_pages() unit test only works if the current working directory is at the root of Pelican package. This does not sit well with PyCharm IDE, where pytest can be executed from any subdirectory within that Pelican package.

Furthermore, this implies that elsewhere the code depends on the current working directory, which is harder to pin down via unit test.

Anchor the unit test code by pushing current working directory into the stack, changing to root dir of Pelican package, then restoring original directory path.

Platform

Click to expand

Platform

  • OS version and name: Linux 6.1.0-21-amd64 SMP PREEMPT_DYNAMIC Debian 6.1.90-1 (2024-05-03) x86_64 GNU/Linux
  • Python version: 3.11.2
  • Pelican version: HEAD (513abbf)
  • Link to theme: m.css
  • Links to plugins: pelican-plugins
  • Link to your site: n/a
  • Link to your source: n/a
@egberts egberts added the bug label Jul 23, 2024
egberts pushed a commit to egberts/pelican that referenced this issue Jul 23, 2024
egberts pushed a commit to egberts/pelican that referenced this issue Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant