简体   繁体   English

如何在Travis CI中为python禁用一些测试

[英]How I can disable some tests in Travis CI for python

I would like to know. 我想知道。 How I can disable some tests in Travis CI. 如何禁用Travis CI中的某些测试。 I am trying wrote something it but it didn't work 我正在尝试写一些东西,但是没有用

@pytest.mark.skipif("TRAVIS" in os.environ and os.environ["TRAVIS"] == "true", 
reason="Skipping this test on Travis CI.")
@pytest.mark.asyncio
async def test_can_unwatch_remote_actor(remote_manager):

In Travis configuration you can add custom environment variable. 在Travis配置中,您可以添加自定义环境变量。 For example you can add in your .travis.yml file this line 例如,您可以在.travis.yml文件中添加以下行

env: TRAVIS=true

then use it in skipif . 然后在skipif使用它。

If you would like to test it locally and you work on UNIX like system (eg. Linux, MacOS) you can test it locally with 如果您想在本地进行测试,并且在UNIX之类的系统(例如Linux,MacOS)上工作,则可以使用

TRAVIS=true pytest ..

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM