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

test: remove unused imports in test code #1947

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion test/jsonld/runner.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: UTF-8 -*-
import json
from functools import partial

from rdflib import ConjunctiveGraph
from rdflib.compare import isomorphic
Expand Down
2 changes: 1 addition & 1 deletion test/jsonld/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from typing import Any, Dict

from rdflib.plugins.shared.jsonld import context, errors
from rdflib.plugins.shared.jsonld.context import Context, Term
from rdflib.plugins.shared.jsonld.context import Context


# exception utility (see also nose.tools.raises)
Expand Down
3 changes: 1 addition & 2 deletions test/jsonld/test_localsuite.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import json
import os
from os import chdir, environ, getcwd
from os import chdir, getcwd
from os import path as p

import pytest
Expand Down
1 change: 0 additions & 1 deletion test/jsonld/test_testsuite.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import pytest

import rdflib
import rdflib.plugins.parsers.jsonld as parser
from rdflib.term import URIRef

from . import runner
Expand Down
1 change: 0 additions & 1 deletion test/test_conjunctivegraph/test_conjunctive_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
Tests for ConjunctiveGraph that do not depend on the underlying store
"""

from os import path

import pytest

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,7 @@
import os
from test.data import TEST_DATA_DIR, bob, cheese
from test.data import context1 as c1
from test.data import context2 as c2
from test.data import hates, likes, michel, pizza, tarek
from test.data import TEST_DATA_DIR, cheese, likes, michel, pizza, tarek

from rdflib import ConjunctiveGraph, Graph, URIRef
from rdflib import ConjunctiveGraph, Graph

sportquadstrig = open(os.path.join(TEST_DATA_DIR, "sportquads.trig")).read()

Expand Down
5 changes: 2 additions & 3 deletions test/test_dataset/test_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@

import pytest

from rdflib import FOAF, XSD, BNode, URIRef, plugin
from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Dataset, Graph
from rdflib.plugins.stores.sparqlstore import SPARQLUpdateStore
from rdflib import URIRef, plugin
from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, Dataset

# Will also run SPARQLUpdateStore tests against local SPARQL1.1 endpoint if
# available. This assumes SPARQL1.1 query/update endpoints running locally at
Expand Down
4 changes: 0 additions & 4 deletions test/test_graph/test_graph.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-
import logging
import os
import shutil
import sys
import unittest
from pathlib import Path
from tempfile import mkdtemp, mkstemp
from test.data import TEST_DATA_DIR, bob, cheese, hates, likes, michel, pizza, tarek
from test.utils import GraphHelper, get_unique_plugin_names
from typing import Callable, Optional, Set
Expand Down
2 changes: 0 additions & 2 deletions test/test_graph/test_graph_cbd.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
import os
from test.data import TEST_DATA_DIR
from test.utils import GraphHelper

import pytest

from rdflib import Graph, Namespace
from rdflib.compare import isomorphic
from rdflib.term import URIRef

EXAMPLE_GRAPH_FILE_PATH = TEST_DATA_DIR / "spec" / "cbd" / "example_graph.rdf"
Expand Down
1 change: 0 additions & 1 deletion test/test_graph/test_graph_formula.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import os
import sys
from tempfile import mkdtemp, mkstemp

import pytest
Expand Down
2 changes: 1 addition & 1 deletion test/test_graph/test_graph_generators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import os
from test.data import TEST_DATA_DIR, bob, cheese, hates, likes, michel, pizza, tarek

from rdflib import Graph, URIRef
from rdflib import Graph

timblcardn3 = open(os.path.join(TEST_DATA_DIR, "timbl-card.n3")).read()

Expand Down
2 changes: 1 addition & 1 deletion test/test_graph/test_slice.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from test.data import bob, cheese, hates, likes, michel, pizza, tarek

from rdflib import Graph, URIRef
from rdflib import Graph


class TestGraphSlice:
Expand Down
2 changes: 1 addition & 1 deletion test/test_graph/test_variants.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

import rdflib.compare
import rdflib.util
from rdflib.graph import ConjunctiveGraph, Graph
from rdflib.graph import ConjunctiveGraph
from rdflib.namespace import XSD
from rdflib.term import URIRef
from rdflib.util import guess_format
Expand Down
1 change: 0 additions & 1 deletion test/test_issues/test_issue1043.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import decimal
import io
import sys
import unittest
Expand Down
1 change: 0 additions & 1 deletion test/test_issues/test_issue1160.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

import rdflib
from rdflib import ConjunctiveGraph
from rdflib.parser import URLInputSource

QUERY = """
SELECT DISTINCT ?g
Expand Down
1 change: 0 additions & 1 deletion test/test_issues/test_issue190.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import textwrap
import unittest

import pytest

Expand Down
1 change: 0 additions & 1 deletion test/test_issues/test_issue223.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from rdflib.collection import Collection
from rdflib.graph import Graph
from rdflib.term import URIRef

Expand Down
2 changes: 1 addition & 1 deletion test/test_issues/test_issue446.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# coding=utf-8
# test for https://github.com/RDFLib/rdflib/issues/446

from rdflib import Graph, Literal, URIRef
from rdflib import Graph, URIRef


def test_sparql_unicode():
Expand Down
3 changes: 1 addition & 2 deletions test/test_issues/test_issue563.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
from rdflib import BNode, Graph, Literal, Namespace
from rdflib.compare import isomorphic
from rdflib import Graph, Literal, Namespace

EX = Namespace("http://example.org/")
QUERY = """
Expand Down
4 changes: 2 additions & 2 deletions test/test_issues/test_issue579.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# test for https://github.com/RDFLib/rdflib/issues/579

from rdflib import Graph, Literal, Namespace, URIRef
from rdflib.namespace import FOAF, RDF
from rdflib import Graph, Literal, Namespace
from rdflib.namespace import FOAF


def test_issue579():
Expand Down
4 changes: 2 additions & 2 deletions test/test_issues/test_issue733.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@

import unittest

from rdflib import Graph, URIRef
from rdflib.namespace import RDF, RDFS, Namespace, NamespaceManager
from rdflib import Graph
from rdflib.namespace import Namespace


class TestIssue733(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_issues/test_issue953.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import unittest
from fractions import Fraction

from rdflib import ConjunctiveGraph, Graph, Literal, URIRef
from rdflib import Literal, URIRef


class TestIssue953(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion test/test_issues/test_issue977.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import unittest

from rdflib import RDF, RDFS, XSD, Graph, Literal, URIRef
from rdflib import RDFS, Graph, Literal, URIRef


class TestIssue977(unittest.TestCase):
Expand Down
1 change: 0 additions & 1 deletion test/test_issues/test_issue_git_336.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
# mypy: warn_return_any, no_implicit_reexport, strict_equality

import rdflib
from rdflib.plugins.parsers.notation3 import BadSyntax

# Test for https://github.com/RDFLib/rdflib/issues/336
# and https://github.com/RDFLib/rdflib/issues/345
Expand Down
1 change: 0 additions & 1 deletion test/test_literal/test_datetime.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import sys
from datetime import datetime

from isodate import UTC, datetime_isoformat
Expand Down
2 changes: 1 addition & 1 deletion test/test_literal/test_xmlliterals.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import textwrap
import xml.dom.minidom
from typing import Callable, Optional, Sequence
from typing import Callable, Sequence

import pytest

Expand Down
1 change: 0 additions & 1 deletion test/test_misc/test_bnode_ncname.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# -*- coding: utf-8 -*-
import re
from hashlib import md5
from uuid import uuid4

# Adapted from http://icodesnip.com/snippet/python/simple-universally-unique-id-uuid-or-guid
Expand Down
2 changes: 1 addition & 1 deletion test/test_mulpath_n3.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from rdflib import RDFS, URIRef
from rdflib import URIRef
from rdflib.paths import ZeroOrMore


Expand Down
1 change: 0 additions & 1 deletion test/test_namespace/test_definednamespace.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import inspect
import json
import logging
import subprocess
import sys
Expand Down
1 change: 0 additions & 1 deletion test/test_namespace/test_namespace.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import unittest
from contextlib import ExitStack
from multiprocessing.sharedctypes import Value
from typing import Any, Optional, Type, Union
from unittest.case import expectedFailure
from warnings import warn
Expand Down
1 change: 0 additions & 1 deletion test/test_nt_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
import re
import unittest
from pathlib import Path
from test import TEST_DIR
from test.data import TEST_DATA_DIR
from urllib.request import urlopen

Expand Down
1 change: 0 additions & 1 deletion test/test_parsers/test_broken_parse_data_from_jena.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import pytest

import rdflib
from rdflib.compare import isomorphic

# Recovered from
# https://github.com/RDFLib/rdflib/tree/6b4607018ebf589da74aea4c25408999f1acf2e2
Expand Down
1 change: 0 additions & 1 deletion test/test_parsers/test_nquads.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import os
import unittest
from test import TEST_DIR
from test.data import TEST_DATA_DIR

from rdflib import ConjunctiveGraph, Namespace, URIRef
Expand Down
14 changes: 1 addition & 13 deletions test/test_parsers/test_parser_turtlelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,10 @@
import enum
import itertools
from dataclasses import dataclass, field
from typing import (
Callable,
Collection,
Dict,
Iterator,
List,
NamedTuple,
Optional,
Set,
Tuple,
Union,
)
from typing import Callable, Dict, Iterator, List, Set, Tuple, Union

import pytest
from _pytest.mark.structures import Mark, MarkDecorator, ParameterSet
from pyparsing import Opt

from rdflib import XSD, Graph, Literal, Namespace
from rdflib.term import Identifier
Expand Down
2 changes: 0 additions & 2 deletions test/test_serializers/test_serializer.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import enum
import importlib
import itertools
import logging
import re
Expand Down Expand Up @@ -28,7 +27,6 @@
import rdflib.plugin
from rdflib import RDF, XSD, Graph, Literal, Namespace, URIRef
from rdflib.graph import DATASET_DEFAULT_GRAPH_ID, ConjunctiveGraph, Dataset
from rdflib.plugins.sparql.parser import DEBUG
from rdflib.serializer import Serializer

EGSCHEMA = Namespace("example:")
Expand Down
2 changes: 0 additions & 2 deletions test/test_serializers/test_serializer_trix.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@

from io import BytesIO

import pytest

from rdflib.graph import ConjunctiveGraph, Graph
from rdflib.term import Literal, URIRef

Expand Down
3 changes: 1 addition & 2 deletions test/test_sparql/test_construct_bindings.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
import unittest
from test.utils import eq_

from rdflib import BNode, Graph, Literal, URIRef
from rdflib.compare import isomorphic
from rdflib import Graph, Literal, URIRef
from rdflib.plugins.sparql import prepareQuery


Expand Down
5 changes: 1 addition & 4 deletions test/test_sparql/test_datetime_processing.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
import io
from pprint import pprint
from test.utils import eq_

import rdflib
from rdflib import XSD, BNode, Graph, Literal, URIRef
from rdflib.compare import isomorphic
from rdflib.plugins.sparql import prepareQuery
from rdflib import Graph


def test_dateTime_dateTime_subs_issue():
Expand Down
2 changes: 0 additions & 2 deletions test/test_sparql/test_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,7 @@
import pytest

from rdflib import Graph, Literal, URIRef, Variable
from rdflib.compare import isomorphic
from rdflib.namespace import XSD
from rdflib.plugins.sparql import prepareQuery
from rdflib.term import BNode, Identifier


Expand Down
1 change: 0 additions & 1 deletion test/test_store/test_store_auditable.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

from rdflib import Graph, Namespace
from rdflib.plugins.stores.auditable import AuditableStore
from rdflib.store import VALID_STORE

EX = Namespace("http://example.org/")

Expand Down
2 changes: 1 addition & 1 deletion test/test_typing.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
# mypy: no_implicit_optional, warn_redundant_casts, warn_unused_ignores
# mypy: warn_return_any, no_implicit_reexport, strict_equality

from typing import Set, Tuple, Union
from typing import Set, Tuple

# TODO Bug - rdflib.plugins.sparql.prepareQuery() will run fine if this
# test is run, but mypy can't tell the symbol is exposed.
Expand Down
1 change: 0 additions & 1 deletion test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
from test.utils.graph import cached_graph
from test.utils.namespace import RDFT
from typing import Any, Collection, List, Optional, Set, Tuple, Type, Union
from unittest.case import expectedFailure

import pytest

Expand Down
5 changes: 2 additions & 3 deletions test/test_w3c_spec/test_n3_w3c.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
test suite."""
import itertools
import os
from test import TEST_DIR
from test.data import TEST_DATA_DIR
from test.utils.manifest import RDFTest, read_manifest
from test.utils.namespace import RDFT
from typing import Callable, Dict

import pytest

from rdflib import Graph, logger
from rdflib import Graph
from rdflib.compare import graph_diff, isomorphic
from rdflib.namespace import Namespace, split_uri
from rdflib.namespace import split_uri
from rdflib.term import Node, URIRef

verbose = False
Expand Down