From 77a68b0529e195f948eabb465d74d69a9f44ad9f Mon Sep 17 00:00:00 2001 From: Shengjing Zhu Date: May 15 2017 09:35:41 +0000 Subject: use module import method to call flake8 when test Fix tests on system that /usr/bin/flake8 points to py3 version Signed-off-by: Shengjing Zhu --- diff --git a/tests/test_style.py b/tests/test_style.py index 74c1333..3d8cd87 100644 --- a/tests/test_style.py +++ b/tests/test_style.py @@ -1,5 +1,6 @@ import os import subprocess +import sys import unittest @@ -15,7 +16,7 @@ class TestStyle(unittest.TestCase): This test runs flake8 on the code, and will fail if it returns a non-zero exit code. """ # We ignore E712, which disallows non-identity comparisons with True and False - flake8_command = ['flake8', '--ignore=E712,W503', REPO_PATH] + flake8_command = [sys.executable, '-m', 'flake8', '--ignore=E712,W503', REPO_PATH] self.assertEqual(subprocess.call(flake8_command), 0)