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

Permit coverage JSON strings and objects #74

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Pennycook
Copy link
Contributor

Related issues

Closes #60.

Proposed changes

  • Relax restrictions on types expected by coverage validation routine to permit JSON objects.
  • Adjust test_coverage_json_invalid to reflect that passing objects is now valid.
  • Adjust test_coverage_json_valid to test JSON objects as well as JSON strings.

Although many of our early tests used coverage strings loaded from CSV files,
we have encountered real use-cases where it is easier to work directly with
coverage represented as Python objects.

Signed-off-by: John Pennycook <[email protected]>
Previously, the test threw a TypeError because the JSON was provided as an
object instead of as a string. Now that providing coverage objects is
supported, the test is expected to throw a ValueError: it is valid to pass
an object, but the object itself is invalid.

Signed-off-by: John Pennycook <[email protected]>
@Pennycook Pennycook added the enhancement New feature or request label Nov 15, 2024
@Pennycook Pennycook added this to the 1.0.0 milestone Nov 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support coverage strings and objects
1 participant