We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ecc6a6e commit 9f3fb47Copy full SHA for 9f3fb47
tests/git_test.py
@@ -8,7 +8,7 @@
8
from unittest import mock
9
10
import coveralls.git
11
-
+from coveralls.exception import CoverallsException
12
13
GIT_COMMIT_MSG = 'first commit'
14
GIT_EMAIL = '[email protected]'
@@ -108,6 +108,22 @@ def test_gitlog_envvars(self):
108
}
109
110
111
+class GitInfoTestNotAGitRepository(unittest.TestCase):
112
+ def setUp(self):
113
+ self.dir = tempfile.mkdtemp()
114
+
115
+ os.chdir(self.dir)
116
117
+ def tearDown(self):
118
+ shutil.rmtree(self.dir)
119
120
+ def test_gitlog_not_a_git_repo(self):
121
+ git_info = coveralls.git.git_info()
122
123
+ self.assertRaises(CoverallsException)
124
+ assert git_info == {}
125
126
127
class GitInfoTestBranch(GitTest):
128
@mock.patch.dict(os.environ, {
129
'GITHUB_ACTIONS': 'true',
0 commit comments