pytest-dev / pytest-dev/pytest-html
Add expanding the environment variables in csspath
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 779
- Forks
- 260
- PR merge metrics
- No merged PRs in 30d
Description
Custom CSS (Cascasding Style Sheets) can be passed on the command line using the --css option
In the current realization pytest-html checks existing of the css file with the next code
for csspath in config.getoption("css"):
if not Path(csspath).exists():
missing_css_files.append(csspath)
Сould you add the ability to use environment variables in the css file path? This has already been implemented for html path in HTMLReport class by os.path.expandvars
It would look like:
for csspath in config.getoption("css"):
absolute_css_path = Path(os.path.expandvars(csspath)).expanduser().absolute()
if not absolute_css_path.exists():
missing_css_files.append(absolute_css_path)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the css option handling and the existing os.path.expandvars usage in the HTMLReport class. Update the CSS path existence check consistently with that behavior, then verify that an environment-variable CSS path is accepted and missing expanded paths are reported correctly.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- css, python
- Domain
- cli, testing-qa
- Issue type
- Feature
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 48/100