pytest-api-framework-alpha 0.3.2__tar.gz → 0.3.3__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 (31) hide show
  1. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/PKG-INFO +1 -1
  2. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/conftest.py +2 -0
  3. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/script.py +6 -0
  4. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/pytest_api_framework_alpha.egg-info/PKG-INFO +1 -1
  5. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/setup.py +1 -1
  6. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/__init__.py +0 -0
  7. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/base_class.py +0 -0
  8. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/db/__init__.py +0 -0
  9. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/db/mysql_db.py +0 -0
  10. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/db/redis_db.py +0 -0
  11. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/exceptions.py +0 -0
  12. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/exit_code.py +0 -0
  13. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/extract.py +0 -0
  14. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/global_attribute.py +0 -0
  15. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/http_client.py +0 -0
  16. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/render_data.py +0 -0
  17. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/report.py +0 -0
  18. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/startapp.py +0 -0
  19. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/utils/__init__.py +0 -0
  20. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/utils/common.py +0 -0
  21. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/utils/date_util.py +0 -0
  22. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/utils/encrypt.py +0 -0
  23. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/utils/log_util.py +0 -0
  24. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/utils/mock_util.py +0 -0
  25. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/utils/yaml_util.py +0 -0
  26. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/framework/validate.py +0 -0
  27. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/pytest_api_framework_alpha.egg-info/SOURCES.txt +0 -0
  28. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/pytest_api_framework_alpha.egg-info/dependency_links.txt +0 -0
  29. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/pytest_api_framework_alpha.egg-info/requires.txt +0 -0
  30. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/pytest_api_framework_alpha.egg-info/top_level.txt +0 -0
  31. {pytest_api_framework_alpha-0.3.2 → pytest_api_framework_alpha-0.3.3}/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.2
3
+ Version: 0.3.3
4
4
  Author: alpha
5
5
  Author-email:
6
6
  Requires-Python: >=3.6
@@ -614,6 +614,8 @@ def sort(case_items):
614
614
  def pytest_collection_finish(session):
615
615
  """获取最终排序后的 items 列表"""
616
616
  logger.info(f"共收集到 {len(session.items)} 个测试用例")
617
+ if not session.items:
618
+ pytest.exit("未收集到用例")
617
619
  # 过滤掉item名称是test_setup或test_teardown的
618
620
  session.items = [item for item in session.items if item.name not in ["test_setup", "test_teardown"]]
619
621
 
@@ -16,3 +16,9 @@ class BaseScript(__BaseScript):
16
16
 
17
17
  def default_app(self, app):
18
18
  return app or self.app
19
+
20
+ def context_set(self, key, value):
21
+ self.context.set(app=self.app, key=key, value=value)
22
+
23
+ def context_get(self, key):
24
+ return self.context.get(app=self.app, key=key)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest-api-framework-alpha
3
- Version: 0.3.2
3
+ Version: 0.3.3
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.2",
5
+ version="0.3.3",
6
6
  packages=find_packages(),
7
7
  author="alpha",
8
8
  author_email="",