Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Detecting when code is run on Travis CI

I have a nose test that uses a pathname to a png file in the tests directory. One path works in local testing, one path works on Travis. How do I check when the code is run on Travis?

Edit: Here is the actual code.

like image 237
ArekBulski Avatar asked Aug 22 '16 19:08

ArekBulski


1 Answers

To check the existence of TRAVIS:

import os
is_travis = 'TRAVIS' in os.environ
like image 83
Laurent LAPORTE Avatar answered Sep 19 '22 20:09

Laurent LAPORTE