Skip to content

Commit 110c299

Browse files
committed
test: don't run long tests by default
1 parent 72a2eb1 commit 110c299

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

test/test_git.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import itertools
44
import logging
5+
import os
56
import platform
67
import unittest
78

@@ -79,6 +80,8 @@ def test_nonversion_tags(self):
7980
version.local = (f'git{self.repo_head_hexsha}',)
8081
self.assertEqual(version, upcoming_version)
8182

83+
@unittest.skipUnless(
84+
os.environ.get('TEST_LONG', False) or os.environ.get('CI'), 'skipping long test')
8285
def test_too_long_no_tag(self):
8386
self.git_commit_new_file()
8487
self.repo.create_tag('v4.0.0')

test/test_query.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,11 @@ def _query_test_case(self, paths, query_function):
6060
else:
6161
_LOG.debug('%s: %s', path, version)
6262

63+
@unittest.skipUnless(
64+
os.environ.get('TEST_LONG', False) or os.environ.get('CI'), 'skipping long test')
6365
def test_query_git_repo(self):
6466
self._check_examples_count('git repo', GIT_REPO_EXAMPLES)
67+
_LOG.debug('testing query_git_repo() on %i repositories', len(GIT_REPO_EXAMPLES))
6568
self._query_test_case(GIT_REPO_EXAMPLES, query_git_repo)
6669

6770
def test_predict_caller_bad(self):
@@ -81,7 +84,10 @@ def test_predict_caller_bad(self):
8184
_LOG.warning('removed %s from sys.path', project_path_str)
8285
project_file_path.unlink()
8386

87+
@unittest.skipUnless(
88+
os.environ.get('TEST_LONG', False) or os.environ.get('CI'), 'skipping long test')
8489
def test_predict_git_repo(self):
90+
_LOG.debug('testing predict_git_repo() on %i repositories', len(GIT_REPO_EXAMPLES))
8591
self._query_test_case(GIT_REPO_EXAMPLES, predict_git_repo)
8692

8793
@unittest.skipIf(not METADATA_JSON_EXAMPLE_PATHS, 'no "metadata.json" files found')

0 commit comments

Comments
 (0)