From 3b458e0cacbfb1e789a860f291f8063045b639a4 Mon Sep 17 00:00:00 2001 From: Oliver Copping Date: Thu, 18 Apr 2024 08:30:36 +0100 Subject: [PATCH] Removed test_mypy --- tests/protocols/test_protocols.py | 33 ------------------------------- 1 file changed, 33 deletions(-) diff --git a/tests/protocols/test_protocols.py b/tests/protocols/test_protocols.py index 868554eb10..a411055a0b 100644 --- a/tests/protocols/test_protocols.py +++ b/tests/protocols/test_protocols.py @@ -15,36 +15,3 @@ def test_readable(): def test_pausable(): assert isinstance(sim.det1, bs_protocols.AsyncPausable) - - -# I think the commented out tests pass because __getattr__ is implemented, but not sure -@pytest.mark.skip(reason="ophyd missing py.typed to communicate type hints to mypy") -@pytest.mark.parametrize( - "type_, hardware, pass_", - [ - ("Readable", "ABDetector(name='hi')", True), - ("Readable", "SynAxis(name='motor1')", True), - ("Readable", "TrivialFlyer()", False), - ("Configurable", "ABDetector(name='hi')", True), - ("Pausable", "ABDetector(name='hi')", True), - ], -) -def test_mypy(type_, hardware, pass_): - template = f""" -from ophyd_async import protocols as bs_protocols -from ophyd import sim - -var: bs_protocols.{type_} = sim.{hardware} -""" - - with tempfile.NamedTemporaryFile("wt") as f: - f.write(template) - f.seek(0) - stdout, stderr, exit = mypy.api.run([f.name]) - # pass true means exit 0, pass false means nonzero exit - try: - assert exit != pass_ - except AssertionError: - print(stdout) - print(stderr) - raise