summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Schofield <git@ajschof.me>2025-02-07 15:13:21 +0000
committerAlex Schofield <git@ajschof.me>2025-02-07 15:13:21 +0000
commit8499a404322dc37af2afae05ec5630b366656b27 (patch)
tree33aa0d4b418e6bfaa867cef25514e9ee6695bfe7 /src
parent5a12715276d7166eed0ff776a7b13b0670c8a28c (diff)
downloadtp-logger-8499a404322dc37af2afae05ec5630b366656b27.tar.gz
tp-logger-8499a404322dc37af2afae05ec5630b366656b27.zip
improve debug flag checks for pytest
Diffstat (limited to 'src')
-rw-r--r--src/discover.py6
1 files changed, 3 insertions, 3 deletions
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
git.ajschof.me — hosted by ajschofield — powered by cgit