Skip to content
Merged
12 changes: 10 additions & 2 deletions packages/django-google-spanner/.coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,16 @@

[run]
branch = True
source =
django_spanner

[paths]
source =
django_spanner
*/site-packages/django_spanner

[report]
fail_under = 80
fail_under = 68
show_missing = True
exclude_lines =
# Re-enable the standard pragma
Expand All @@ -20,4 +27,5 @@ exclude_lines =
# Ignore abstract methods
raise NotImplementedError
omit =
*/site-packages/*.py
tests/*
*/tests/*
14 changes: 10 additions & 4 deletions packages/django-google-spanner/noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,21 +118,21 @@ def default(session):
session.install(
*UNIT_TEST_STANDARD_DEPENDENCIES,
*UNIT_TEST_EXTERNAL_DEPENDENCIES,
*UNIT_TEST_DEPENDENCIES,
*UNIT_TEST_MOCKSERVER_DEPENDENCIES,
)
session.install("-e", ".")

# Run py.test against the unit tests.
# Run py.test against unit and mockserver tests.
session.run(
"py.test",
"--quiet",
"--cov=django_spanner",
"--cov=tests.unit",
"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=75",
"--cov-fail-under=0",
os.path.join("tests", "unit"),
os.path.join("tests", "mockserver_tests"),
*session.posargs,
)

Expand All @@ -155,6 +155,12 @@ def mockserver(session):
session.run(
"py.test",
"--quiet",
"--cov=django_spanner",
"--cov=tests.mockserver_tests",
Comment on lines +158 to +159

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Since tests/* and */tests/* are explicitly omitted in .coveragerc, specifying --cov=tests.mockserver_tests here is redundant and will be ignored by coverage. It is cleaner to remove this argument.

Suggested change
"--cov=django_spanner",
"--cov=tests.mockserver_tests",
"--cov=django_spanner",

"--cov-append",
"--cov-config=.coveragerc",
"--cov-report=",
"--cov-fail-under=0",
os.path.join("tests", "mockserver_tests"),
*session.posargs,
)
Expand Down
Loading