• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

pybuilder / pybuilder / 16613314016

30 Jul 2025 04:14AM UTC coverage: 84.008% (-0.1%) from 84.146%
16613314016

push

github

arcivanov
Release 0.13.16

2167 of 2671 branches covered (81.13%)

Branch coverage included in aggregate %.

5534 of 6496 relevant lines covered (85.19%)

36.25 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

65.0
/src/main/python/pybuilder/plugins/python/remote_tools/coverage_tool.py
1
#   -*- coding: utf-8 -*-
2
#
3
#   This file is part of PyBuilder
4
#
5
#   Copyright 2011-2020 PyBuilder Team
6
#
7
#   Licensed under the Apache License, Version 2.0 (the "License");
8
#   you may not use this file except in compliance with the License.
9
#   You may obtain a copy of the License at
10
#
11
#       http://www.apache.org/licenses/LICENSE-2.0
12
#
13
#   Unless required by applicable law or agreed to in writing, software
14
#   distributed under the License is distributed on an "AS IS" BASIS,
15
#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
#   See the License for the specific language governing permissions and
17
#   limitations under the License.
18

19
from pybuilder.plugins.python.remote_tools import RemoteObjectPipe, Tool
44✔
20

21
__all__ = ["CoverageTool"]
44✔
22

23

24
class CoverageTool(Tool):
44✔
25
    def __init__(self, source_path, omit_patterns, *cov_args, **cov_kwargs):
44✔
26
        self.source_path = source_path
44✔
27
        self.omit_patterns = omit_patterns
44✔
28
        self.cov_args = cov_args
44✔
29
        self.cov_kwargs = cov_kwargs
44✔
30
        self.coverage = None
44✔
31

32
    def start(self, pipe):
44✔
33
        # type: (RemoteObjectPipe) -> None
34
        from .._coverage_util import patch_coverage
×
35

36
        patch_coverage()
×
37

38
        from coverage import coverage as coverage_factory
×
39

40
        coverage = coverage_factory(*self.cov_args, **self.cov_kwargs)
×
41
        self.coverage = coverage
×
42
        coverage.start()
×
43

44
    def stop(self, pipe):
44✔
45
        # type: (RemoteObjectPipe) -> None
46
        from .._coverage_util import save_normalized_coverage
44✔
47

48
        self.coverage.stop()
44✔
49
        save_normalized_coverage(self.coverage, self.source_path, self.omit_patterns)
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc