Fix tests execution

See #2442
Try a different method, the previous one wasn't working in Travis
Merge pull request #2462 from vlakoff/develop-4

Fix tests execution