pytest-api-framework-alpha 0.3.12__tar.gz → 0.3.14__tar.gz

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.
Files changed (32) hide show
  1. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/PKG-INFO +1 -1
  2. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/base_class.py +4 -4
  3. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/conftest.py +4 -3
  4. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/db/mysql_db.py +11 -5
  5. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/pytest_api_framework_alpha.egg-info/PKG-INFO +1 -1
  6. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/setup.py +1 -1
  7. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/__init__.py +0 -0
  8. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/db/__init__.py +0 -0
  9. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/db/redis_db.py +0 -0
  10. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/exceptions.py +0 -0
  11. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/exit_code.py +0 -0
  12. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/extract.py +0 -0
  13. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/global_attribute.py +0 -0
  14. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/http_client.py +0 -0
  15. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/render_data.py +0 -0
  16. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/report.py +0 -0
  17. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/script.py +0 -0
  18. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/startapp.py +0 -0
  19. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/utils/__init__.py +0 -0
  20. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/utils/common.py +0 -0
  21. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/utils/date_util.py +0 -0
  22. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/utils/encrypt.py +0 -0
  23. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/utils/lark_util.py +0 -0
  24. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/utils/log_util.py +0 -0
  25. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/utils/mock_util.py +0 -0
  26. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/utils/yaml_util.py +0 -0
  27. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/framework/validate.py +0 -0
  28. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/pytest_api_framework_alpha.egg-info/SOURCES.txt +0 -0
  29. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/pytest_api_framework_alpha.egg-info/dependency_links.txt +0 -0
  30. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/pytest_api_framework_alpha.egg-info/requires.txt +0 -0
  31. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/pytest_api_framework_alpha.egg-info/top_level.txt +0 -0
  32. {pytest_api_framework_alpha-0.3.12 → pytest_api_framework_alpha-0.3.14}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-api-framework-alpha
3
- Version: 0.3.12
3
+ Version: 0.3.14
4
4
  Author: alpha
5
5
  Author-email:
6
6
  Requires-Python: >=3.6
@@ -162,7 +162,7 @@ class BaseTestCase(ExtendBaseTestCase):
162
162
  :param new_base: 新的 base,如 'https://new.example.com'
163
163
  :return: 替换后的 URL
164
164
  """
165
- if url.startswith("http"):
165
+ if url.startswith("http") and "mce.sg" not in url:
166
166
  return url
167
167
  parsed_url = urlparse(url)
168
168
  new_base_parsed = urlparse(new_base)
@@ -205,9 +205,9 @@ class BaseTestCase(ExtendBaseTestCase):
205
205
 
206
206
  def regenerate_hot_wallet_for_psp(self, participant_code):
207
207
  """
208
-
208
+
209
209
  :param participant_code: partner或end-user的code
210
- :return:
210
+ :return:
211
211
  """
212
212
  # 删除wallet_service中的钱包
213
213
  self.logger.info(f"重置{participant_code}热钱包")
@@ -235,7 +235,7 @@ class BaseTestCase(ExtendBaseTestCase):
235
235
 
236
236
  def regenerate_hot_wallet_for_buyer(self, partner_account, merchant_participant_code, buyer_participant_code):
237
237
  """
238
-
238
+
239
239
  :param partner_account: partner账号
240
240
  :param merchant_participant_code: merchant code
241
241
  :param buyer_participant_code: buyer code
@@ -279,9 +279,10 @@ def pytest_generate_tests(metafunc):
279
279
 
280
280
 
281
281
  def pytest_collection_modifyitems(items):
282
+ # 过滤掉不在收集范围的case
283
+ items = [item for item in items if getattr(item, "callspec", None)]
282
284
  # 重新排序
283
285
  new_items = sort(items)
284
- # Demo: new_items = [items[0],items[2],items[1],items[3]]
285
286
  items[:] = new_items
286
287
  for item in items:
287
288
  # 获取mark标记
@@ -292,6 +293,8 @@ def pytest_collection_modifyitems(items):
292
293
  item.add_marker(mark)
293
294
 
294
295
 
296
+
297
+
295
298
  def pytest_collection_finish(session):
296
299
  """获取最终排序后的 items 列表"""
297
300
  logger.info(f"共收集到 {len(session.items)} 个测试用例")
@@ -800,11 +803,9 @@ def sort(case_items):
800
803
  # 生成每个组当前的索引
801
804
  ori_name_temp = None
802
805
  ori_name_list = []
803
-
804
806
  for item in non_custom_scope_items:
805
807
  clase_id = item.cls.__name__
806
808
  original_name = item.originalname
807
-
808
809
  if ori_name_temp is None or ori_name_temp == original_name:
809
810
  ori_name_temp = original_name
810
811
  case_suite_num += 1
@@ -139,8 +139,14 @@ class MysqlDB:
139
139
 
140
140
  @staticmethod
141
141
  def custom_serializer(obj):
142
- if isinstance(obj, datetime):
143
- return obj.strftime('%Y-%m-%d %H:%M:%S') # 转换时间格式
144
- elif isinstance(obj, Decimal):
145
- return float(obj) # 转换 Decimal 为 float
146
- raise TypeError(f"Type {type(obj)} not serializable")
142
+ try:
143
+ if isinstance(obj, datetime):
144
+ return obj.strftime('%Y-%m-%d %H:%M:%S')
145
+ elif isinstance(obj, Decimal):
146
+ return float(obj)
147
+ elif isinstance(obj, bytes):
148
+ return obj.decode(errors='ignore', encoding='utf-8')
149
+ # 不处理的类型:直接返回原对象
150
+ return obj
151
+ except Exception:
152
+ return obj
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-api-framework-alpha
3
- Version: 0.3.12
3
+ Version: 0.3.14
4
4
  Author: alpha
5
5
  Author-email:
6
6
  Requires-Python: >=3.6
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
2
2
 
3
3
  setup(
4
4
  name="pytest-api-framework-alpha", # 包名(必须唯一)
5
- version="0.3.12",
5
+ version="0.3.14",
6
6
  packages=find_packages(),
7
7
  author="alpha",
8
8
  author_email="",