From c0939975b882d1107663754337ff8ceae8e30769 Mon Sep 17 00:00:00 2001 From: slaclau Date: Wed, 17 Jul 2024 23:46:09 +0100 Subject: [PATCH] Update tests in demo/broadway --- test/demo/broadway/conftest.py | 6 ------ test/demo/broadway/test_broadway.py | 4 +++- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/test/demo/broadway/conftest.py b/test/demo/broadway/conftest.py index b4eac42..8318421 100644 --- a/test/demo/broadway/conftest.py +++ b/test/demo/broadway/conftest.py @@ -2,17 +2,11 @@ import subprocess -def pytest_runtest_setup(item): - print(f"pytest_runtest_setup({item}") - - def pytest_configure(config): - print("Configure") subprocess.run(["pkill", "gtk4-broadwayd"]) subprocess.Popen(["/usr/bin/gtk4-broadwayd", ":5"]) (pathlib.Path(__file__).parent / "results").mkdir(parents=True, exist_ok=True) def pytest_unconfigure(config): - print("Unconfigure") subprocess.run(["pkill", "gtk4-broadwayd"]) diff --git a/test/demo/broadway/test_broadway.py b/test/demo/broadway/test_broadway.py index 944dd1f..a8f82cb 100644 --- a/test/demo/broadway/test_broadway.py +++ b/test/demo/broadway/test_broadway.py @@ -79,7 +79,7 @@ def end(): @pytest.mark.parametrize("demo", chain(*demos.values())) -def test_demo(demo, browser): +def test_demo(demo, browser, capsys): app = DemoApplication( demo, browser, application_id=f"io.github.slaclau.plotly_gtk.{demo}" ) @@ -88,6 +88,8 @@ def test_demo(demo, browser): directory = (pathlib.Path(__file__).parent / "results").resolve() img = Image.open(directory / f"{demo}.png") assert np.mean(img.convert("RGB").getdata()) < 0xFF + out, err = capsys.readouterr() + assert not err if __name__ == "__main__": if len(sys.argv) > 1: