Skip to content

Commit

Permalink
black format tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pattonw committed Nov 16, 2023
1 parent cd4ae55 commit 5f39387
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 15 deletions.
10 changes: 2 additions & 8 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
from funlib.persistence.graphs import (
SQLiteGraphDataBase
)
from funlib.persistence.graphs import SQLiteGraphDataBase

import pytest
import pymongo

from pathlib import Path


@pytest.fixture(
params=(
pytest.param("sqlite"),
)
)
@pytest.fixture(params=(pytest.param("sqlite"),))
def provider_factory(request, tmpdir):
# provides a factory function to generate graph provider
# can provide either mongodb graph provider or file graph provider
Expand Down
31 changes: 24 additions & 7 deletions tests/test_graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ def test_graph_read_and_update_specific_attrs(provider_factory):
nx.set_edge_attributes(limited_graph, 5, "c")

try:
graph_provider.write_attrs(limited_graph, edge_attrs=["c"], node_attrs=["selected"])
graph_provider.write_attrs(
limited_graph, edge_attrs=["c"], node_attrs=["selected"]
)
except NotImplementedError:
pytest.xfail()

Expand Down Expand Up @@ -163,8 +165,13 @@ def test_graph_read_unbounded_roi(provider_factory):
graph.add_edge(57, 23, selected=True, a=100, b=2)
graph.add_edge(2, 42, selected=True, a=101, b=3)

graph_provider.write_nodes(graph.nodes(), )
graph_provider.write_edges(graph.nodes(), graph.edges(), )
graph_provider.write_nodes(
graph.nodes(),
)
graph_provider.write_edges(
graph.nodes(),
graph.edges(),
)

graph_provider = provider_factory("r+")
limited_graph = graph_provider.read_graph(
Expand Down Expand Up @@ -226,8 +233,13 @@ def test_graph_io(provider_factory):
graph.add_edge(57, 23)
graph.add_edge(2, 42)

graph_provider.write_nodes(graph.nodes(), )
graph_provider.write_edges(graph.nodes(), graph.edges(), )
graph_provider.write_nodes(
graph.nodes(),
)
graph_provider.write_edges(
graph.nodes(),
graph.edges(),
)

graph_provider = provider_factory("r")
compare_graph = graph_provider[Roi((0, 0, 0), (10, 10, 10))]
Expand Down Expand Up @@ -278,7 +290,9 @@ def test_graph_fail_if_not_exists(provider_factory):
with pytest.raises(Exception):
graph_provider.write_nodes(graph.nodes(), fail_if_not_exists=True)
with pytest.raises(Exception):
graph_provider.write_edges(graph.nodes(), graph.edges(), fail_if_not_exists=True)
graph_provider.write_edges(
graph.nodes(), graph.edges(), fail_if_not_exists=True
)


def test_graph_write_attributes(provider_factory):
Expand All @@ -297,7 +311,10 @@ def test_graph_write_attributes(provider_factory):
graph_provider.write_nodes(graph.nodes(), attributes=["position", "swip"])
except NotImplementedError:
pytest.xfail()
graph_provider.write_edges(graph.nodes(), graph.edges(), )
graph_provider.write_edges(
graph.nodes(),
graph.edges(),
)

graph_provider = provider_factory("r")
compare_graph = graph_provider[Roi((0, 0, 0), (10, 10, 10))]
Expand Down

0 comments on commit 5f39387

Please sign in to comment.