Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] authored and jesslatimer committed Apr 18, 2023
1 parent 6480c2c commit 2976b77
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions test/fuzz_rdflib.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@
import atheris

with atheris.instrument_imports():
from rdflib import Graph
from rdflib.plugins.parsers.notation3 import BadSyntax
from rdflib.exceptions import ParserError
import sys
from xml.sax import SAXParseException

from rdflib import Graph
from rdflib.exceptions import ParserError
from rdflib.plugins.parsers.notation3 import BadSyntax


def test_one_input(data):
# arbitrary byte 'data' created by atheris that mutates each time
Expand All @@ -18,8 +19,10 @@ def test_one_input(data):
format_list = ["xml", "trix", "turtle", "n3", "nt"]
g = Graph()
try:
g.parse(format=fdp.PickValueInList(format_list),
data=fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 100)))
g.parse(
format=fdp.PickValueInList(format_list),
data=fdp.ConsumeUnicodeNoSurrogates(fdp.ConsumeIntInRange(1, 100)),
)
# Data generated is not appropriate, so ignore BadSyntax, SAXParseException and ParserError
except (BadSyntax, SAXParseException, ParserError):
pass
Expand Down

0 comments on commit 2976b77

Please sign in to comment.