Skip to content

Commit 4e62ba9

Browse files
committed
Disable coverage by default for PyPy
1 parent 6feda7d commit 4e62ba9

File tree

1 file changed

+17
-6
lines changed

1 file changed

+17
-6
lines changed

noxfile.py

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,24 @@ def test(session, sqlalchemy):
116116
with_coverage = False
117117
else:
118118
with_coverage = True
119-
pytest_cmd = ["pytest"] + (
120-
session.posargs or [
121-
"--pyargs", "sqlalchemy_mptt",
122-
"--cov", "sqlalchemy_mptt", "--cov-report", "term-missing:skip-covered",
123-
"-W", "error:::sqlalchemy_mptt"
119+
if with_coverage:
120+
coverage_options = [
121+
"--cov", "sqlalchemy_mptt",
122+
"--cov-report", "term-missing:skip-covered",
123+
"--cov-report", "xml"
124124
]
125-
) + (["--cov-report", "xml"] if with_coverage else [])
125+
elif session.python.startswith("pypy"):
126+
# Disable coverage for PyPy as it slows down the tests significantly
127+
# See: https://github.com/sqlalchemy/sqlalchemy/issues/9154#issuecomment-1687420057
128+
coverage_options = []
129+
else:
130+
coverage_options = [
131+
"--cov", "sqlalchemy_mptt",
132+
"--cov-report", "term-missing:skip-covered"
133+
]
134+
pytest_cmd = ["pytest"] + coverage_options + (
135+
session.posargs or ["--pyargs", "sqlalchemy_mptt", "-W", "error:::sqlalchemy_mptt"]
136+
)
126137
session.run(*pytest_cmd)
127138

128139

0 commit comments

Comments
 (0)