Skip to content

Commit

Permalink
Use descriptive attribute name for callback test
Browse files Browse the repository at this point in the history
Use a more descriptive attribute name and value for
when_imagej_starts() test.
  • Loading branch information
elevans committed Jul 15, 2024
1 parent e00da05 commit d0eed46
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ def ij(request):
legacy = request.config.getoption("--legacy")
headless = request.config.getoption("--headless")

imagej.when_imagej_starts(
lambda ij: setattr(ij, "_when_imagej_starts_result", "success")
)
imagej.when_imagej_starts(lambda ij: setattr(ij, "_testing", True))

mode = "headless" if headless else "interactive"
ij = imagej.init(ij_dir, mode=mode, add_legacy=legacy)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ def test_when_imagej_starts(ij):
when_imagej_starts, which injects a small piece of data into the gateway
object. We check for that data here to make sure the callback happened.
"""
assert "success" == getattr(ij, "_when_imagej_starts_result", None)
assert True is getattr(ij, "_testing", True)

0 comments on commit d0eed46

Please sign in to comment.