Skip to content

Commit 801083f

Browse files
committed
Added missing method no_branch_lines to FileReporter
1 parent 61a724c commit 801083f

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

django_coverage_plugin/plugin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,9 @@ def statements(self):
226226

227227
return source_lines
228228

229+
def no_branch_lines(self):
230+
return set()
231+
229232

230233
def running_sum(seq):
231234
total = 0

tests/test_simple.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,15 @@ def test_string_template(self):
137137
options={},
138138
)
139139
self.assertEqual(text, "Hello, World!")
140+
141+
142+
class BranchTest(DjangoPluginTestCase):
143+
144+
def test_with_branch_enabled(self):
145+
self.make_template('Hello')
146+
text = self.run_django_coverage(
147+
options={'source': ["."], 'branch': True}
148+
)
149+
self.assertEqual(text, 'Hello')
150+
self.assertEqual(self.get_line_data(), [-1, 1])
151+
self.assertEqual(self.get_analysis(), ([1], []))

0 commit comments

Comments
 (0)