~cjwatson/click/fix-tests-installation

« back to all changes in this revision

Viewing changes to click/tests/integration/helpers.py

  • Committer: Colin Watson
  • Date: 2014-09-04 13:57:36 UTC
  • Revision ID: cjwatson@canonical.com-20140904135736-t05iqgc6y9on6zxt
Call skipTest in ClickTestCase.setUp rather than using allow_integration helper everywhere.

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    except Exception:
39
39
        return False
40
40
 
41
 
def allow_integration():
42
 
    return "TEST_INTEGRATION" in os.environ
43
 
 
44
41
 
45
42
@contextlib.contextmanager
46
43
def chdir(target):
52
49
        os.chdir(curdir)
53
50
 
54
51
 
55
 
@unittest.skipIf(not allow_integration(), "Skipping integration tests")
56
52
class ClickTestCase(unittest.TestCase):
57
53
 
58
54
    @classmethod
61
57
 
62
58
    def setUp(self):
63
59
        super(ClickTestCase, self).setUp()
 
60
        if "TEST_INTEGRATION" not in os.environ:
 
61
            self.skipTest("Skipping integration tests")
64
62
        self.temp_dir = tempfile.mkdtemp()
65
63
 
66
64
    def tearDown(self):