Skip to content

Commit

Permalink
refresh only when necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
gtfierro committed Jan 24, 2024
1 parent a95c838 commit adcad5a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions generate_brick.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,9 @@ def handle_deprecations():
graph, _ = env.resolve_uri(uri)
env.import_graph(G, graph)

# add new Brick to ontology environment
env.refresh()

# validate Brick
valid, _, report = G.validate(engine="topquadrant")
if not valid:
Expand Down
3 changes: 3 additions & 0 deletions tests/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import ontoenv

env = ontoenv.OntoEnv(initialize=True, search_dirs=["support/"])
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def pytest_configure(config):

@pytest.fixture()
def brick_with_imports():
env = ontoenv.OntoEnv(initialize=True, search_dirs=["support/"])
env = ontoenv.OntoEnv(search_dirs=["support/"])
g = brickschema.Graph()
g.load_file("Brick.ttl")
g.bind("qudt", QUDT)
Expand Down

0 comments on commit adcad5a

Please sign in to comment.