qase-python-commons 3.1.2__py3-none-any.whl → 3.1.4__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.

Potentially problematic release.


This version of qase-python-commons might be problematic. Click here for more details.

qase/commons/logger.py CHANGED
@@ -11,7 +11,7 @@ class Logger:
11
11
  if not os.path.exists(dir):
12
12
  os.makedirs(dir)
13
13
  self.log_file = os.path.join(dir, f'{filename}')
14
- with open(self.log_file, 'w'):
14
+ with open(self.log_file, 'w', encoding='utf-8'):
15
15
  pass
16
16
 
17
17
  def log(self, message: str, level: str = 'info'):
@@ -19,7 +19,7 @@ class Logger:
19
19
  log = f"[Qase][{time_str}][{level}] {message}\n"
20
20
  print(log)
21
21
  if self.debug:
22
- with open(self.log_file, 'a') as f:
22
+ with open(self.log_file, 'a', encoding='utf-8') as f:
23
23
  f.write(log)
24
24
 
25
25
  def log_debug(self, message: str):
@@ -27,6 +27,6 @@ class Logger:
27
27
  self.log(message, 'debug')
28
28
 
29
29
  @staticmethod
30
- def _get_timestamp(format: str = "%Y%m%d_%H_%M_%S"):
30
+ def _get_timestamp(fmt: str = "%Y%m%d_%H_%M_%S"):
31
31
  now = datetime.datetime.now()
32
- return now.strftime(format)
32
+ return now.strftime(fmt)
@@ -1,4 +1,4 @@
1
- from .step import Step, StepTextData
1
+ from .step import Step
2
2
  from .attachment import Attachment
3
3
 
4
4
 
@@ -41,3 +41,8 @@ class Runtime:
41
41
  self.result.add_attachment(attachment)
42
42
  except Exception as e:
43
43
  raise QaseRuntimeException(e)
44
+
45
+ def clear(self):
46
+ self.result = None
47
+ self.steps = {}
48
+ self.step_id = None
@@ -1,4 +1,5 @@
1
1
  import sys
2
+ import threading
2
3
  import uuid
3
4
  from functools import wraps
4
5
  from ..models.runtime import Runtime
@@ -108,11 +109,14 @@ class NetworkProfiler:
108
109
 
109
110
  class NetworkProfilerSingleton:
110
111
  _instance = None
112
+ _lock = threading.Lock()
111
113
 
112
114
  @staticmethod
113
115
  def init(**kwargs):
114
116
  if NetworkProfilerSingleton._instance is None:
115
- NetworkProfilerSingleton._instance = NetworkProfiler(**kwargs)
117
+ with NetworkProfilerSingleton._lock:
118
+ if NetworkProfilerSingleton._instance is None:
119
+ NetworkProfilerSingleton._instance = NetworkProfiler(**kwargs)
116
120
 
117
121
  @staticmethod
118
122
  def get_instance() -> NetworkProfiler:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: qase-python-commons
3
- Version: 3.1.2
3
+ Version: 3.1.4
4
4
  Summary: A library for Qase TestOps and Qase Report
5
5
  Author-email: Qase Team <support@qase.io>
6
6
  Project-URL: Homepage, https://github.com/qase-tms/qase-python/tree/master/qase-python-commons
@@ -1,7 +1,7 @@
1
1
  qase/commons/__init__.py,sha256=3HI65PJES4Q6YvtkSuRPh6tZboTETJo8wbdHlNYaePU,323
2
2
  qase/commons/config.py,sha256=meRRgDrsA9qQ9fZR4fnP0VdngrKiGcHF9nnJkf3eJpg,8320
3
3
  qase/commons/loader.py,sha256=-MMY4HgSI6q1xq3NaJoq_w4liM73qdFKjYLVCT1E7Pc,1064
4
- qase/commons/logger.py,sha256=Tg1sBWcn-3Tw1YLNj1kTWjGuLFMTNnwTMQmi6dvAbz8,997
4
+ qase/commons/logger.py,sha256=ka5chQYBXLUB5pM4YHDBo3QCZfBTGMtC3H33tI4NbPQ,1027
5
5
  qase/commons/utils.py,sha256=OOr6kQ5hPZEyHXwbwiTOTkonRxmmtkyZPPGqXQKp5vY,2799
6
6
  qase/commons/client/api_v1_client.py,sha256=NVluiG_pBZL4u2D34WtgXaPkA4TdJhmHUNd6rnfcDeg,11178
7
7
  qase/commons/client/api_v2_client.py,sha256=F3wU_2EKe6eUjNRahvnDmpbx99PwZB6Lxc4VPRj7w58,7247
@@ -13,7 +13,7 @@ qase/commons/models/basemodel.py,sha256=nyDSXhpQUecKdzhB-eWqujmso20oXB9p_42qpOsG
13
13
  qase/commons/models/relation.py,sha256=Hscui14vuSdKVdPPej4V1-SF4XHvJ2Tqg0KH8d49dH0,321
14
14
  qase/commons/models/result.py,sha256=im6L5F44yXAyD6HQy8kP9fncjrKn-7HN30ZnezSdi_Q,4423
15
15
  qase/commons/models/run.py,sha256=KkplvlHJNvVLORzVkdz5mHsLFBTUAdtuEYCqCy_RcvU,2469
16
- qase/commons/models/runtime.py,sha256=1euzotexy7iVjJghg_eVaL1F7gRrB3SV8tq8IRNu0P0,1200
16
+ qase/commons/models/runtime.py,sha256=mfK-mOViD1orXOx-jP6nIgtnN0tUmRYY1aMH0qFDmXA,1287
17
17
  qase/commons/models/step.py,sha256=M-btRYZ4febYavDhwFqmKcCdLAgrhtuv7E_M3TKZdfg,4281
18
18
  qase/commons/models/suite.py,sha256=Z2tlxdeIsuzjIoPnuyVq23pt59Yt6LVmofcew5Njk_s,348
19
19
  qase/commons/models/config/api.py,sha256=IyYY2f3ncESUAEGvkE3-meatebBFJdvgo7KNOQnxLE0,288
@@ -27,14 +27,14 @@ qase/commons/models/config/run.py,sha256=QPOPq0__J5Pey2MfjnEgTuCCDYgjog-rjMJBjiM
27
27
  qase/commons/models/config/testops.py,sha256=O5aFtZHYt3Uj8wRT3Vg_U4qBFINy9Dn6lKTDamuK3QE,822
28
28
  qase/commons/profilers/__init__.py,sha256=GhKT5hRbHbhAC4GhdyChA8XoAsGQOnIb8S2Z4-fdS7Q,222
29
29
  qase/commons/profilers/db.py,sha256=Am1tvvLgJq4_A8JsuSeBGf47BD2lnSX-5KiMjSgr-Ko,391
30
- qase/commons/profilers/network.py,sha256=zxW_sErcMgHjzVGxk6Njp23YzhZrGgh7trC1r2zHHjU,4784
30
+ qase/commons/profilers/network.py,sha256=zKNBnTQG4BMg8dn8O--tQzQLpu-qs5ADhHEnqIas0gM,4950
31
31
  qase/commons/profilers/sleep.py,sha256=HT6h0R-2XHZAoBYRxS2T_KC8RrnEoVjP7MXusaE4Nec,1624
32
32
  qase/commons/reporters/__init__.py,sha256=J0aNLzb_MPPT_zF8BtX_w9nj_U7Ad06RGpyWK5Pxq1o,169
33
33
  qase/commons/reporters/core.py,sha256=0x5G-KVfEOWyXiXaX5__7JBIr3Rxy8vhy0cByUSZUc0,8021
34
34
  qase/commons/reporters/report.py,sha256=MPsFv3k2l4652NyXEGFiSmwsSpwZT3Is-lLRXvsniz4,4606
35
35
  qase/commons/reporters/testops.py,sha256=f5BcorFwIK5BSeA4Rv4IKDddkWrAXL_w-Y5Xn--NdYs,6264
36
36
  qase/commons/validators/base.py,sha256=wwSn-4YiuXtfGMGnSKgo9Vm5hAKevVmmfd2Ro6Q7MYQ,173
37
- qase_python_commons-3.1.2.dist-info/METADATA,sha256=9GyQJoBrelspuLI6sceKAYatu5H9h7krHKWKF-tMU2s,1859
38
- qase_python_commons-3.1.2.dist-info/WHEEL,sha256=uCRv0ZEik_232NlR4YDw4Pv3Ajt5bKvMH13NUU7hFuI,91
39
- qase_python_commons-3.1.2.dist-info/top_level.txt,sha256=Mn5aFk7H7Uia4s1NRDsvebu8vCrFy9nOuRIBfkIY5kQ,5
40
- qase_python_commons-3.1.2.dist-info/RECORD,,
37
+ qase_python_commons-3.1.4.dist-info/METADATA,sha256=8r0A6cNd5M0C7MrJ39maclb3oX3HHGmq7xipJiRsBH8,1859
38
+ qase_python_commons-3.1.4.dist-info/WHEEL,sha256=cVxcB9AmuTcXqmwrtPhNK88dr7IR_b6qagTj0UvIEbY,91
39
+ qase_python_commons-3.1.4.dist-info/top_level.txt,sha256=Mn5aFk7H7Uia4s1NRDsvebu8vCrFy9nOuRIBfkIY5kQ,5
40
+ qase_python_commons-3.1.4.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (74.1.1)
2
+ Generator: setuptools (74.1.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5