【问题标题】:Pytest running unittest exit with core dumpPytest 运行 unittest 并退出核心转储
【发布时间】:2018-11-08 02:55:00
【问题描述】:

到目前为止,我们已经使用了 python unittest 框架。由于以下原因,现在我们想开始使用 pytest:

  1. jenkins 的 junit xml 报告
  2. 使用 pytest-xdist 并行执行

我们现有的测试框架包括几个测试类从单个类派生的案例,其中一个类是从unittest.TestCase 派生的,这样它们共享相同的setUp/tearDown。在 pytest 中,我相信它是用夹具完成的。

当我们尝试使用 pytest 运行我们的测试文件夹时,如果类直接派生自 unittest.TestCase,测试运行良好。但是,如果类是从我们的类派生的(如下所示)pytest crash with Abort(core dump)。

class l2_acl_base(unittest.TestCase):
    def setUp(self):
        self.device_name = '/dev/testdev'
        self.create_system_setup()
        self.create_packets()
    def tearDown(self):
        self.device.tearDown()

class acl_force_destination(l2_acl_base):
    def test_acl_force_destination(self):

【问题讨论】:

  • 请显示完整的错误堆栈跟踪。
  • 发生在我身上,错误不是pythonic异常:python [1] 1173852 IOT instruction (core dumped) pytest

标签: pytest python-unittest


【解决方案1】:

我能够将其追溯到 ENV 问题,并且该问题与 pytest 无关 考虑一下这个案例。

【讨论】:

  • 任何细节?我也有同样的问题,也是由于环境变量,但我不知道是哪个或为什么。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2020-06-17
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2014-09-30
  • 1970-01-01
相关资源
最近更新 更多