| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -170,12 +170,9 @@ select = [ | |||
| 170 | 170 | "FLY002", # too many to fix right now | |
| 171 | 171 | "PT018", # too many to fix right now | |
| 172 | 172 | "PLR0124", # too many to fix right now | |
| 173 | - "SIM202" , # too many to fix right now | ||
| 174 | 173 | "PT012" , # too many to fix right now | |
| 175 | 174 | "TID252", # too many to fix right now | |
| 176 | 175 | "PLR0913", # skip this one | |
| 177 | - "SIM102" , # too many to fix right now | ||
| 178 | - "SIM108", # too many to fix right now | ||
| 179 | 176 | "T201", # too many to fix right now | |
| 180 | 177 | "PT004", # nice to have | |
| 181 | 178 | ] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,10 +95,7 @@ def time_changed_millis(millis: float | None = None) -> None: | |||
| 95 | 95 | """Call all scheduled events for a time.""" | |
| 96 | 96 | loop = asyncio.get_running_loop() | |
| 97 | 97 | loop_time = loop.time() | |
| 98 | - if millis is not None: | ||
| 99 | - mock_seconds_into_future = millis / 1000 | ||
| 100 | - else: | ||
| 101 | - mock_seconds_into_future = loop_time | ||
| 98 | + mock_seconds_into_future = millis / 1000 if millis is not None else loop_time | ||
| 102 | 99 | ||
| 103 | 100 | with mock.patch("time.monotonic", return_value=mock_seconds_into_future): | |
| 104 | 101 | for task in list(loop._scheduled): # type: ignore[attr-defined] | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -227,10 +227,7 @@ def mock_record_update_incoming_msg( | |||
| 227 | 227 | generated = r.DNSOutgoing(const._FLAGS_QR_RESPONSE) | |
| 228 | 228 | assert generated.is_response() is True | |
| 229 | 229 | ||
| 230 | - if service_state_change == r.ServiceStateChange.Removed: | ||
| 231 | - ttl = 0 | ||
| 232 | - else: | ||
| 233 | - ttl = 120 | ||
| 230 | + ttl = 0 if service_state_change == r.ServiceStateChange.Removed else 120 | ||
| 234 | 231 | ||
| 235 | 232 | generated.add_answer_at_time( | |
| 236 | 233 | r.DNSText( | |
@@ -1575,9 +1572,8 @@ async def test_close_zeroconf_without_browser_before_start_up_queries(): | |||
| 1575 | 1572 | registration_name = f"xxxyyy.{type_}" | |
| 1576 | 1573 | ||
| 1577 | 1574 | def on_service_state_change(zeroconf, service_type, state_change, name): | |
| 1578 | - if name == registration_name: | ||
| 1579 | - if state_change is ServiceStateChange.Added: | ||
| 1580 | - service_added.set() | ||
| 1575 | + if name == registration_name and state_change is ServiceStateChange.Added: | ||
| 1576 | + service_added.set() | ||
| 1581 | 1577 | ||
| 1582 | 1578 | aiozc = AsyncZeroconf(interfaces=["127.0.0.1"]) | |
| 1583 | 1579 | zeroconf_browser = aiozc.zeroconf | |
@@ -1644,9 +1640,8 @@ async def test_close_zeroconf_without_browser_after_start_up_queries(): | |||
| 1644 | 1640 | registration_name = f"xxxyyy.{type_}" | |
| 1645 | 1641 | ||
| 1646 | 1642 | def on_service_state_change(zeroconf, service_type, state_change, name): | |
| 1647 | - if name == registration_name: | ||
| 1648 | - if state_change is ServiceStateChange.Added: | ||
| 1649 | - service_added.set() | ||
| 1643 | + if name == registration_name and state_change is ServiceStateChange.Added: | ||
| 1644 | + service_added.set() | ||
| 1650 | 1645 | ||
| 1651 | 1646 | aiozc = AsyncZeroconf(interfaces=["127.0.0.1"]) | |
| 1652 | 1647 | zeroconf_browser = aiozc.zeroconf | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -76,7 +76,7 @@ def test_dns_address_repr(self): | |||
| 76 | 76 | def test_dns_question_repr(self): | |
| 77 | 77 | question = r.DNSQuestion("irrelevant", const._TYPE_SRV, const._CLASS_IN | const._CLASS_UNIQUE) | |
| 78 | 78 | repr(question) | |
| 79 | - assert not question != question | ||
| 79 | + assert (question != question) is False | ||
| 80 | 80 | ||
| 81 | 81 | def test_dns_service_repr(self): | |
| 82 | 82 | service = r.DNSService( | |
@@ -112,7 +112,7 @@ def test_service_info_dunder(self): | |||
| 112 | 112 | addresses=[socket.inet_aton("10.0.1.2")], | |
| 113 | 113 | ) | |
| 114 | 114 | ||
| 115 | - assert not info != info | ||
| 115 | + assert (info != info) is False | ||
| 116 | 116 | repr(info) | |
| 117 | 117 | ||
| 118 | 118 | def test_service_info_text_properties_not_given(self): | |
| Back | FazBrowse Home | New Git URL |
0 commit comments