Fix test_generators.py for correct pointing to test file.
egberts opened this issue · 0 comments
egberts commented
- [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