zoukankan      html  css  js  c++  java
  • python测试相关小问题

    实操中的小问题

    pycharm 一次运行多个test configuration

    项目分层,分包之后,tests也分到不同层的不同project里了,tests也分开。

    为了防止基层模块改动,影响上层,希望一次运行多个test configuration

    在edit configuration里,在某一个configuration里添加其他的

    tests下文件夹不要和被测module同名

    import的低级错误记录:

    工程如果长这样:

    moduleA

      __init__,py

          B.py

    tests

      moduleA

        __init__.py

        test_B.py

    test_B.py开头如果import moduleA会报错

    在tests路径下,注意一切都要以test开头,现在这么写,表示在tests下面已经有一个同名的组件moduleA了!

       把tests/moduleA改成tests/test_moduleA 就可以了

    tests

      test_moduleA

        __init__.py

        test_B.py

  • 相关阅读:
    Python的递归深度问题
    Python之多进程
    Python之多线程
    Git的基本操作
    ref与out区别
    Numpy基本操作
    面向对象中有哪些双下线方法及应用场景
    上下文管理
    Local与LocalStack
    基于列表实现栈
  • 原文地址:https://www.cnblogs.com/xuanmanstein/p/8779391.html
Copyright © 2011-2022 走看看