Skip to content

Validate YAML syntax in license dump tests#5068

Open
Shaurya-dev7 wants to merge 1 commit into
aboutcode-org:developfrom
Shaurya-dev7:validate-license-yaml-tests
Open

Validate YAML syntax in license dump tests#5068
Shaurya-dev7 wants to merge 1 commit into
aboutcode-org:developfrom
Shaurya-dev7:validate-license-yaml-tests

Conversation

@Shaurya-dev7
Copy link
Copy Markdown

Fixes #3947

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Summary

Add YAML syntax validation checks during the license dump workflow using PyYAML validation.

This also extends the related tests to ensure invalid YAML content raises an error instead of silently passing through the dump generation flow.

Changes

  • Added a helper validation function for generated YAML content in license_db.py
  • Added YAML syntax validation during license dump generation
  • Added test coverage for invalid YAML handling using pytest monkeypatch
  • Improved error reporting for YAML parsing failures

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 this pull request may close these issues.

Ensure that we check the YAML syntax of license data files in tests.

1 participant