From: 
Subject: Debian changes

The Debian packaging of python-solax is maintained in git, using a workflow
similar to the one described in dgit-maint-merge(7).
The Debian delta is represented by this one combined patch; there isn't a
patch queue that can be represented as a quilt series.

A detailed breakdown of the changes is available from their canonical
representation -- git commits in the packaging repository.
For example, to see the changes made by the Debian maintainer in the first
upload of upstream version 1.2.3, you could use:

    % git clone https://git.dgit.debian.org/python-solax
    % cd python-solax
    % git log --oneline 1.2.3..debian/1.2.3-1 -- . ':!debian'

(If you have dgit, use `dgit clone python-solax`, rather than plain `git clone`.)

We don't use debian/source/options single-debian-patch because it has bugs.
Therefore, NMUs etc. may nevertheless have made additional patches.

---

diff --git a/solax/discovery.py b/solax/discovery.py
index b9c5dda..4451ec7 100644
--- a/solax/discovery.py
+++ b/solax/discovery.py
@@ -29,6 +29,8 @@ REGISTRY: Set[Type[Inverter]] = {
 
 logging.basicConfig(level=logging.INFO)
 
+_STAGGER_DELAY_SECONDS = 1
+
 
 class DiscoveryKeywords(TypedDict, total=False):
     inverters: Sequence[Type[Inverter]]
@@ -113,7 +115,7 @@ async def discover(
     async def stagger() -> None:
         for http_client, future in requests.items():
             future.set_result(asyncio.create_task(http_client.request()))
-            await asyncio.sleep(1)
+            await asyncio.sleep(_STAGGER_DELAY_SECONDS)
 
     staggered = asyncio.create_task(stagger())
 
diff --git a/tests/conftest.py b/tests/conftest.py
index 7057cae..509a79f 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -4,3 +4,26 @@ from tests.fixtures import inverters_fixture_all_zero  # noqa: F401
 from tests.fixtures import inverters_garbage_fixture  # noqa: F401
 from tests.fixtures import inverters_under_test  # noqa: F401
 from tests.fixtures import simple_http_fixture  # noqa: F401
+
+import pytest
+
+from solax import discovery
+from solax.inverter import Inverter
+import solax.inverters
+
+@pytest.fixture(autouse=True)
+def no_proxy_env(monkeypatch):
+    """Ensure proxy env vars are unset for all tests."""
+    for var in ('HTTP_PROXY', 'HTTPS_PROXY', 'http_proxy', 'https_proxy'):
+        monkeypatch.delenv(var, raising=False)
+
+@pytest.fixture(autouse=True, scope="session")
+def populate_registry():
+    """Populate REGISTRY from solax.inverters package for uninstalled development."""
+    if not discovery.REGISTRY:
+        # REGISTRY is empty -> package not installed, use __all__ from solax.inverters
+        classes = [
+            getattr(solax.inverters, name)
+            for name in solax.inverters.__all__
+        ]
+        discovery.REGISTRY.update(cls for cls in classes if issubclass(cls, Inverter))
diff --git a/tests/test_discovery.py b/tests/test_discovery.py
index 3a2f956..3b9b743 100644
--- a/tests/test_discovery.py
+++ b/tests/test_discovery.py
@@ -1,4 +1,5 @@
 import asyncio
+import importlib
 
 import pytest
 
@@ -8,16 +9,27 @@ from solax.discovery import REGISTRY, DiscoveryError
 from solax.inverter import InverterError
 from solax.inverters import X1Boost
 
+discovery_module = importlib.import_module("solax.discovery")
+TIME_FACTOR = 0.01
+
+
+@pytest.fixture(autouse=True)
+def fast_discovery_stagger(monkeypatch):
+    """Preserve relative timing without making the test suite wait minutes."""
+    monkeypatch.setattr(
+        discovery_module, "_STAGGER_DELAY_SECONDS", 1 * TIME_FACTOR
+    )
+
 
 class DelayedX1Boost(X1Boost):
     async def get_data(self) -> InverterResponse:
-        await asyncio.sleep(10)
+        await asyncio.sleep(10 * TIME_FACTOR)
         return await super().get_data()
 
 
 class DelayedFailedX1Boost(X1Boost):
     async def make_request(self) -> InverterResponse:
-        await asyncio.sleep(5)
+        await asyncio.sleep(5 * TIME_FACTOR)
         raise InverterError
 
 
@@ -57,7 +69,7 @@ async def test_discovery_cancelled_error_while_staggering(
     task = asyncio.create_task(
         solax.discover(*conn, return_when=asyncio.FIRST_EXCEPTION)
     )
-    await asyncio.sleep(1)
+    await asyncio.sleep(0.5 * TIME_FACTOR)
     task.cancel()
     with pytest.raises(asyncio.CancelledError):
         await task
@@ -78,7 +90,7 @@ async def test_discovery_cancelled_error_after_staggering(
     task = asyncio.create_task(
         solax.discover(*conn, inverters=inverters, return_when=asyncio.FIRST_EXCEPTION)
     )
-    await asyncio.sleep(7)
+    await asyncio.sleep(7 * TIME_FACTOR)
     task.cancel()
     with pytest.raises(asyncio.CancelledError):
         await task
