PyCharm测试配置可以导出以供在另一个项目中使用/重新导入吗?

huangapple go评论106阅读模式
英文:

Can pycharm testing configurations be exported for use/re-import into another project?

问题

Is there a way to export the testing configurations that can be reimported to a fresh project?

背景:尽管venv文件夹被排除在外,但它被打开了。当我点击文件夹以折叠它时,pycharm会卡住(_macOS_的彩色旋转等待图标)。这种情况已经反复发生。

虽然我可能会考虑重新创建项目,但问题在于有许多测试配置,这些配置太有价值,不能简单丢弃。我需要一种方法来保存它们并将它们导入到重新创建的项目中。

英文:

Is there a way to export the testing configurations that can be reimported to a fresh project?

Background: Even though the venv folder is Excluded it is opened up. When I click on the folder to collapse it, the pycharm hangs (macOS beach ball). This has happened repeatedly.

While I might consider recreating the project, the problem is there are many testing configurations that are too valuable to simply throw away. I need a way to save them and pull them into the newly re-done project.

PyCharm测试配置可以导出以供在另一个项目中使用/重新导入吗?

答案1

得分: 1

@bad_coder 在他的评论中提供了一个可行的答案。

> 我认为与IDE集成的唯一解决方案是在运行配置中设置存储为项目文件。某些路径可能是硬编码的(如项目、解释器、CWD和路径)...对生成的XML文件进行搜索/替换(手动或编写脚本)可能是完成此任务的最有效方式,因为项目/解释器通常由IDE管理,其中一些路径(如项目)将是IDE字符串而不是文件路径。

更多关于这个方法的详细信息将在后续提供。

英文:

@bad_coder has provided a workable answer in his comment.

> I think the only solution that's integrated with the IDE is setting Store as project file in the run configurations. Some paths are likely to be hardcoded (like Project, Interpreter, CWD and path)... Using search/replaced on the resulting XML files (by hand or writing a script) is likely the most efficient way to get it done, because project/interpreter is usually managed by the IDE some of those paths (like Project) will be an IDE string not a filepath.

More details on this approach to follow..

huangapple
  • 本文由 发表于 2023年5月26日 01:18:31
  • 转载请务必保留本文链接:https://go.coder-hub.com/76334825.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定