From 8499a404322dc37af2afae05ec5630b366656b27 Mon Sep 17 00:00:00 2001 From: Alex Schofield Date: Fri, 7 Feb 2025 15:13:21 +0000 Subject: improve debug flag checks for pytest --- src/discover.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/discover.py') diff --git a/src/discover.py b/src/discover.py index e2351b3..f5d12ec 100644 --- a/src/discover.py +++ b/src/discover.py @@ -16,13 +16,13 @@ async def discover(debug=False): except Exception: return [] -async def main(): - check_debug = os.getenv("DEBUG", "FALSE").upper() == "TRUE" +async def main(debug_flag=None): + check_debug = debug_flag if debug_flag is not None else os.getenv("DEBUG", "FALSE").upper() == "TRUE" if check_debug: print("DEBUG MODE ENABLED") devices = await discover(debug=check_debug) - print(devices) + return devices if __name__ == "__main__": asyncio.run(main()) \ No newline at end of file -- cgit v1.2.3