Pypy解释器无法识别nosetests,而pypy3可以

2024-04-25 09:14:55 发布

您现在位置:Python中文网/ 问答频道 /正文

我已经编写了一个脚本来在不同版本的Python和pypypy上测试我的Python库。 对于Py3

python setup.py test

很好用。 但在pypy, 它运行0 tests。没有失败,只有零测试。 这是我的剧本

language: python

matrix:
  include:
    - python: "pypy"
      env:
        - TEST_PY3="false"
    - python: "pypy3"
      env:
        - TEST_PY3="true"


before_install:

 - sudo apt-get update
 - sudo apt-get install build-essential

install:
  - if [[ "${TEST_PY3}" == "false" ]]; then
      pip install Cython;
      python setup.py install;
    fi

  - if [[ "${TEST_PY3}" == "true" ]]; then
      pip install Cython;
      python setup.py install;
    fi

script:
 - python setup.py test

我正在使用nosetests。我的setup.py的这一部分可能会有所帮助

test_suite         = 'nose.collector',
tests_require      = ['nose>=0.10.1']

nosetestspypy之间有什么问题吗?你知道吗


Tags: installpytestenvfalsetruegetif