pytest-testkit 1.0.3__tar.gz → 1.0.3a2__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 (58) hide show
  1. {pytest_testkit-1.0.3/pytest_testkit.egg-info → pytest_testkit-1.0.3a2}/PKG-INFO +1 -1
  2. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pyproject.toml +1 -1
  3. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/device.py +16 -12
  4. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/plugin.py +1 -1
  5. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2/pytest_testkit.egg-info}/PKG-INFO +1 -1
  6. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/LICENSE +0 -0
  7. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/MANIFEST.in +0 -0
  8. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/README.md +0 -0
  9. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/__init__.py +0 -0
  10. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/__init__.py +0 -0
  11. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/__init__.py +0 -0
  12. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/excel.py +0 -0
  13. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/ftp.py +0 -0
  14. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/local_exec.py +0 -0
  15. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/sftp.py +0 -0
  16. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/base/ssh.py +0 -0
  17. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/__init__.py +0 -0
  18. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/__init__.py +0 -0
  19. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/allocator.py +0 -0
  20. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/environment/manager.py +0 -0
  21. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/__init__.py +0 -0
  22. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/filters.py +0 -0
  23. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/infra_logger.py +0 -0
  24. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/common/log/manager.py +0 -0
  25. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/pre_action/__init__.py +0 -0
  26. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/pre_action/action.py +0 -0
  27. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/pre_action/exceptions.py +0 -0
  28. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit/lib/pre_action/registry.py +0 -0
  29. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/SOURCES.txt +0 -0
  30. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/dependency_links.txt +0 -0
  31. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/entry_points.txt +0 -0
  32. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/requires.txt +0 -0
  33. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/pytest_testkit.egg-info/top_level.txt +0 -0
  34. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/requirements.txt +0 -0
  35. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/setup.cfg +0 -0
  36. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_collect_case_with_inifile.py +0 -0
  37. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_creation.py +0 -0
  38. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_exit_docker.py +0 -0
  39. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_getitem.py +0 -0
  40. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_integration.py +0 -0
  41. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_is_interactive_shell.py +0 -0
  42. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_non_shell_commands.py +0 -0
  43. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_sendcmd.py +0 -0
  44. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_docker_proxy_sendcmd_interactive.py +0 -0
  45. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_env_nodes_filter.py +0 -0
  46. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_get_inifile_info.py +0 -0
  47. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_get_item_case_info.py +0 -0
  48. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_local_exec.py +0 -0
  49. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_local_interactive.py +0 -0
  50. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_log_factory.py +0 -0
  51. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_log_factory_integration.py +0 -0
  52. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_security_features.py +0 -0
  53. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_cwd.py +0 -0
  54. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_file_ops.py +0 -0
  55. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_ignore_err.py +0 -0
  56. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_only_stdout.py +0 -0
  57. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_remove_command_echo.py +0 -0
  58. {pytest_testkit-1.0.3 → pytest_testkit-1.0.3a2}/tests/test_ssh_success.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest_testkit
3
- Version: 1.0.3
3
+ Version: 1.0.3a2
4
4
  Summary: Pytest plugin for Infra logging framework and environment management
5
5
  Author: Huawei
6
6
  License: MIT License
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pytest_testkit"
7
- version = "1.0.3"
7
+ version = "1.0.3a2"
8
8
  description = "Pytest plugin for Infra logging framework and environment management"
9
9
  readme = "README.md"
10
10
  license = { file = "LICENSE" }
@@ -772,13 +772,11 @@ class Device:
772
772
  result_dict = ssh_connect.ssh_cmd_interactive(param)
773
773
 
774
774
  # 发送命令日志: HTML location 列显示 sendcmd[设备短名],
775
- # 消息带上 shell 提示符还原终端效果
775
+ # 消息不带 shell 提示符只打印命令本身
776
+ new_prompt = getattr(ssh_connect, "last_prompt", "") if ssh_connect else ""
776
777
  if echo_output and not _SESSION_QUIET_STDOUT:
777
778
  node_tag = f"[{_short_name(self.name)}]"
778
- prompt = getattr(ssh_connect, "last_prompt", "") if ssh_connect else ""
779
- # root@lease-env1792052573-5446-nodes1-device1792052573-2811:~#ls -l
780
- # 打印回显如上 需要带上 shell 提示符吗
781
- send_msg = f"{prompt}{cmd}" if prompt else cmd
779
+ send_msg = cmd
782
780
  if cwd is not None:
783
781
  send_msg += f" (cwd: {cwd})"
784
782
  logger.info(
@@ -796,9 +794,6 @@ class Device:
796
794
  echo_parts.append(stderr)
797
795
  result_echo = "\n".join(echo_parts)
798
796
  if result_echo:
799
- new_prompt = (
800
- getattr(ssh_connect, "last_prompt", "") if ssh_connect else ""
801
- )
802
797
  # 回显结果以shell提示符结尾移除它, 没有提示符则直接打印不拼装
803
798
  if new_prompt and result_echo.endswith(new_prompt):
804
799
  recv_msg = result_echo[: -len(new_prompt)].rstrip("\n")
@@ -808,6 +803,14 @@ class Device:
808
803
  else:
809
804
  logger.info("(empty)", extra={"op_type": f"recvcmd{node_tag}"})
810
805
 
806
+ # 移除 stdout 末尾的 shell 提示符
807
+ if new_prompt:
808
+ stdout_val = result_dict.get("stdout", "") or ""
809
+ if stdout_val.endswith(new_prompt):
810
+ result_dict["stdout"] = stdout_val[: -len(new_prompt)]
811
+
812
+ logger.info(f"test tzing: {result_dict}")
813
+
811
814
  # 按用户原始 only_stdout 决定返回值
812
815
  if only_stdout:
813
816
  return result_dict.get("stdout", "")
@@ -1079,10 +1082,11 @@ class Device:
1079
1082
  self._thread_local.sshConnect.close()
1080
1083
  self._set_logged_in(False)
1081
1084
 
1082
- logger.info(
1083
- f"Disconnected from {self.__str__()}",
1084
- extra={"op_type": f"disconnect[{_short_name(self.name)}]"},
1085
- )
1085
+ # # 移除 放到调度日志中
1086
+ # logger.info(
1087
+ # f"Disconnected from {self.__str__()}",
1088
+ # extra={"op_type": f"disconnect[{_short_name(self.name)}]"},
1089
+ # )
1086
1090
 
1087
1091
  return True
1088
1092
  except Exception as e:
@@ -1064,7 +1064,7 @@ def pytest_runtest_teardown(item):
1064
1064
  if item.config.env_initialized and hasattr(item, "infra_environments"):
1065
1065
  env_manager = item.config.env_manager
1066
1066
  env_manager.release_environments(item.nodeid)
1067
- logger.info(f"Released test environments")
1067
+ # logger.info(f"Released test environments")
1068
1068
 
1069
1069
  result = getattr(item, "infra_test_result", "unknown")
1070
1070
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pytest_testkit
3
- Version: 1.0.3
3
+ Version: 1.0.3a2
4
4
  Summary: Pytest plugin for Infra logging framework and environment management
5
5
  Author: Huawei
6
6
  License: MIT License
File without changes