infrahub-testcontainers 1.2.4__py3-none-any.whl → 1.2.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- from datetime import UTC, datetime
1
+ from datetime import datetime, timezone
2
2
  from enum import Enum
3
3
  from typing import Any
4
4
 
@@ -27,7 +27,7 @@ class InfrahubResultContext(BaseModel):
27
27
 
28
28
  class InfrahubActiveMeasurementItem(BaseModel):
29
29
  definition: MeasurementDefinition
30
- start_time: datetime = datetime.now(UTC)
30
+ start_time: datetime = Field(default_factory=lambda: datetime.now(timezone.utc))
31
31
  context: dict[str, Any] = Field(default_factory=dict)
32
32
 
33
33
 
@@ -1,6 +1,6 @@
1
1
  import hashlib
2
2
  import json
3
- from datetime import UTC, datetime
3
+ from datetime import datetime, timezone
4
4
  from types import TracebackType
5
5
  from typing import Any
6
6
 
@@ -35,7 +35,7 @@ class InfrahubPerformanceTest:
35
35
  self.env_vars = {}
36
36
  self.project_name = ""
37
37
  self.test_info = {}
38
- self.start_time = datetime.now(UTC)
38
+ self.start_time = datetime.now(timezone.utc)
39
39
  self.end_time: datetime | None = None
40
40
  self.results_url = results_url
41
41
  self.scraper_endpoint = ""
@@ -57,7 +57,7 @@ class InfrahubPerformanceTest:
57
57
 
58
58
  def finalize(self, session: pytest.Session) -> None:
59
59
  if self.initialized:
60
- self.end_time = datetime.now(UTC)
60
+ self.end_time = datetime.now(timezone.utc)
61
61
  self.extract_test_session_information(session)
62
62
  self.send_results()
63
63
 
@@ -129,7 +129,7 @@ class InfrahubPerformanceTest:
129
129
  if not exc_type and self.active_measurements:
130
130
  self.add_measurement(
131
131
  definition=self.active_measurements.definition,
132
- value=(datetime.now(UTC) - self.active_measurements.start_time).total_seconds() * 1000,
132
+ value=(datetime.now(timezone.utc) - self.active_measurements.start_time).total_seconds() * 1000,
133
133
  context=self.active_measurements.context,
134
134
  )
135
135
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: infrahub-testcontainers
3
- Version: 1.2.4
3
+ Version: 1.2.5
4
4
  Summary: Testcontainers instance for Infrahub to easily build integration tests
5
5
  Home-page: https://opsmill.com
6
6
  License: Apache-2.0
@@ -6,11 +6,11 @@ infrahub_testcontainers/haproxy.cfg,sha256=QUkG2Xu-hKoknPOeYKAkBT_xJH6U9CfIS0DTM
6
6
  infrahub_testcontainers/helpers.py,sha256=zsvBOql5qM2OX1ybPcklqF-nzWYHkZI3Gk3KZhxWOtU,3578
7
7
  infrahub_testcontainers/host.py,sha256=Z4_gGoGKKeM_HGVS7SdYL1FTNGyLBk8wzicdSKHpfmM,1486
8
8
  infrahub_testcontainers/measurements.py,sha256=gR-uTasSIFCXrwvnNpIpfsQIopKftT7pBiarCgIShaQ,2214
9
- infrahub_testcontainers/models.py,sha256=R735sO9i6D1TTtwlB0rweN3rWmZMYoSFfk1zt5XgT-Y,909
10
- infrahub_testcontainers/performance_test.py,sha256=82g4hfDuEesV7T8U12UjMV7ujZQMy_q30CSNQCdDVlQ,5993
9
+ infrahub_testcontainers/models.py,sha256=ASYyvl7d_WQz_i7y8-3iab9hwwmCl3OCJavqVbe8nXU,954
10
+ infrahub_testcontainers/performance_test.py,sha256=PSE03jevzv63n-v5rxNIzuQsbtCR-pVqLVpJddjCHhs,6025
11
11
  infrahub_testcontainers/plugin.py,sha256=vk33oG44MA2zxZwqMsS8_CkScm5LwuwwFmSOtmeAdMU,5357
12
12
  infrahub_testcontainers/prometheus.yml,sha256=610xQEyj3xuVJMzPkC4m1fRnCrjGpiRBrXA2ytCLa54,599
13
- infrahub_testcontainers-1.2.4.dist-info/METADATA,sha256=9tQPvomzuzoLasyvoqo4rw9aBgjf7y9__410Ez_iwcc,981
14
- infrahub_testcontainers-1.2.4.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
15
- infrahub_testcontainers-1.2.4.dist-info/entry_points.txt,sha256=gHOERdtVE0P8dYz6FHkn2KplpbXvCDJQnuWg_IP0-qQ,76
16
- infrahub_testcontainers-1.2.4.dist-info/RECORD,,
13
+ infrahub_testcontainers-1.2.5.dist-info/METADATA,sha256=XRcGdOcQvTzGYZOegFvLY_BO-QPqzhby22uf7hO5E5A,981
14
+ infrahub_testcontainers-1.2.5.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
15
+ infrahub_testcontainers-1.2.5.dist-info/entry_points.txt,sha256=gHOERdtVE0P8dYz6FHkn2KplpbXvCDJQnuWg_IP0-qQ,76
16
+ infrahub_testcontainers-1.2.5.dist-info/RECORD,,