Skip to content

Address pytest warnings #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
Jun 1, 2025
Prev Previous commit
Next Next commit
Fail on warnings from within the project
  • Loading branch information
fayazkhan committed Jun 1, 2025
commit 85c3cc2619302de924d67bedde215df05d031ca1
15 changes: 11 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,11 +112,18 @@ def test(session, sqlalchemy):
"""
session.install("-r", "requirements-test.txt")
session.install(f"sqlalchemy~={sqlalchemy}.0")
if "--coverage" in session.posargs:
session.run("coverage", "run", "--source=sqlalchemy_mptt", "-m", "pytest", "sqlalchemy_mptt/")
session.run("coverage", "xml")
session.install("-e", ".")
try:
session.posargs.remove("--coverage")
except ValueError:
with_coverage = False
else:
session.run("pytest", "sqlalchemy_mptt/")
with_coverage = True
pytest_cmd = [
"pytest", "--pyargs", "sqlalchemy_mptt",
"--cov", "sqlalchemy_mptt", "--cov-report", "term-missing:skip-covered"
] + ["--cov-report", "xml"] if with_coverage else [] + session.posargs
session.run(*pytest_cmd)


@nox.session(default=False)
Expand Down