user45245
user45245

Reputation: 905

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. 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):

Upvotes: 1

Views: 236

Answers (2)

cclauss
cclauss

Reputation: 751

@pytest.mark.skipif(os.getenv("TRAVIS") == "true",
                    reason="Skipping this test on Travis CI.")

Upvotes: 0

Grzegorz Bokota
Grzegorz Bokota

Reputation: 1804

In Travis configuration you can add custom environment variable. For example you can add in your .travis.yml file this line

env: TRAVIS=true

then use it in 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

TRAVIS=true pytest ..

Upvotes: 0

Related Questions