File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -138,6 +138,30 @@ def test_report_including(self):
138
138
assert "mycode.py " in report
139
139
assert self .last_line_squeezed (report ) == "TOTAL 4 0 100%"
140
140
141
+ def test_omit_files_here (self ):
142
+ # https://github.com/nedbat/coveragepy/issues/1407
143
+ self .make_file ("foo.py" , "" )
144
+ self .make_file ("bar/bar.py" , "" )
145
+ self .make_file ("tests/test_baz.py" , """\
146
+ def test_foo():
147
+ assert True
148
+ test_foo()
149
+ """ )
150
+ self .run_command ("coverage run --source=. --omit='./*.py' -m tests.test_baz" )
151
+ report = self .report_from_command ("coverage report" )
152
+
153
+ # Name Stmts Miss Cover
154
+ # ---------------------------------------
155
+ # tests/test_baz.py 3 0 100%
156
+ # ---------------------------------------
157
+ # TOTAL 3 0 100%
158
+
159
+ assert self .line_count (report ) == 5
160
+ assert "foo" not in report
161
+ assert "bar" not in report
162
+ assert "tests/test_baz.py" in report
163
+ assert self .last_line_squeezed (report ) == "TOTAL 3 0 100%"
164
+
141
165
def test_run_source_vs_report_include (self ):
142
166
# https://github.com/nedbat/coveragepy/issues/621
143
167
self .make_file (".coveragerc" , """\
You can’t perform that action at this time.
0 commit comments