forked from exasol/bucketfs-utils-python
-
Notifications
You must be signed in to change notification settings - Fork 1
/
noxfile.py
26 lines (21 loc) · 979 Bytes
/
noxfile.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import nox
# imports all nox task provided by the toolbox
from exasol.toolbox.nox.tasks import *
from noxconfig import PROJECT_CONFIG
# default actions to be run if nothing is explicitly specified with the -s option
nox.options.sessions = ["project:fix"]
def _coverage(session, config, context) -> None:
# Overrides default implementation of PTB
# in order to only run unit tests for coverage
from exasol.toolbox.nox._test import _unit_tests
command = ["poetry", "run", "coverage", "report", "-m"]
coverage_file = config.root / ".coverage"
coverage_file.unlink(missing_ok=True)
_unit_tests(session, config, context)
session.run(*command)
@nox.session(name="test:coverage", python=False)
def coverage(session) -> None:
from exasol.toolbox.nox._shared import _context
"""Runs all tests (unit + integration) and reports the code coverage"""
context = _context(session, coverage=True)
_coverage(session, PROJECT_CONFIG, context)