From fd5cda4ec60cd1f7f1f4f6746ae9c266d943b05e Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ville=20Skytt=C3=A4?= <ville.skytta@iki.fi>
Date: Mon, 27 Nov 2023 22:59:54 +0200
Subject: [PATCH] Issue bytes vs str related warnings from tests (#101186)

---
 .github/workflows/ci.yaml   | 8 ++++----
 script/lint_and_test.py     | 1 +
 script/scaffold/__main__.py | 3 ++-
 3 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml
index 69e727d3aa9..71030e50074 100644
--- a/.github/workflows/ci.yaml
+++ b/.github/workflows/ci.yaml
@@ -747,7 +747,7 @@ jobs:
             cov_params+=(--cov-report=xml)
           fi
 
-          python3 -X dev -m pytest \
+          python3 -b -X dev -m pytest \
             -qq \
             --timeout=9 \
             --durations=10 \
@@ -784,7 +784,7 @@ jobs:
             cov_params+=(--cov-report=term-missing)
           fi
 
-          python3 -X dev -m pytest \
+          python3 -b -X dev -m pytest \
             -qq \
             --timeout=9 \
             -n auto \
@@ -905,7 +905,7 @@ jobs:
             cov_params+=(--cov-report=term-missing)
           fi
 
-          python3 -X dev -m pytest \
+          python3 -b -X dev -m pytest \
             -qq \
             --timeout=20 \
             -n 1 \
@@ -1029,7 +1029,7 @@ jobs:
             cov_params+=(--cov-report=term-missing)
           fi
 
-          python3 -X dev -m pytest \
+          python3 -b -X dev -m pytest \
             -qq \
             --timeout=9 \
             -n 1 \
diff --git a/script/lint_and_test.py b/script/lint_and_test.py
index ee28d4765d6..48809ae4dcd 100755
--- a/script/lint_and_test.py
+++ b/script/lint_and_test.py
@@ -224,6 +224,7 @@ async def main():
 
     code, _ = await async_exec(
         "python3",
+        "-b",
         "-m",
         "pytest",
         "-vv",
diff --git a/script/scaffold/__main__.py b/script/scaffold/__main__.py
index 8dafd8fa802..ddbd1189e11 100644
--- a/script/scaffold/__main__.py
+++ b/script/scaffold/__main__.py
@@ -103,10 +103,11 @@ def main():
 
     if args.develop:
         print("Running tests")
-        print(f"$ python3 -m pytest -vvv tests/components/{info.domain}")
+        print(f"$ python3 -b -m pytest -vvv tests/components/{info.domain}")
         subprocess.run(
             [
                 "python3",
+                "-b",
                 "-m",
                 "pytest",
                 "-vvv",
-- 
GitLab