Skip to content

Commit

Permalink
Use unittest's --buffer option
Browse files Browse the repository at this point in the history
  • Loading branch information
adamchainz authored and BenRKarl committed Nov 21, 2023
1 parent 1c56079 commit 71dee33
Showing 1 changed file with 21 additions and 28 deletions.
49 changes: 21 additions & 28 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,22 @@

PYTHON_VERSIONS = ["3.7"]

TEST_COMMAND = [
"coverage",
"run",
"--append",
"-m",
"unittest",
"discover",
"--buffer",
"-s=tests",
"-p",
"*_test.py",
]
COVERAGE_COMMAND = [
"coverage", "report", "-m", "--omit=.nox/*,examples/*,*/__init__.py",
]


@nox.session(python=PYTHON_VERSIONS)
def tests(session):
Expand All @@ -25,20 +41,9 @@ def tests(session):
"pyfakefs>=3.5,<3.7",
"coverage==6.5.0",
)
session.run(
"coverage",
"run",
"--append",
"-m",
"unittest",
"discover",
"-s=tests",
"-p",
"*_test.py",
)
session.run(
"coverage", "report", "-m", "--omit=.nox/*,examples/*,*/__init__.py"
)
session.run(*TEST_COMMAND)
session.run(*COVERAGE_COMMAND)


# This session runs all the unit tests but with the lowest-possible versions
# of supported dependencies that are published by Google.
Expand All @@ -59,17 +64,5 @@ def tests_minimum_dependency_versions(session):
"grpcio==1.38.1",
"grpcio-status==1.38.1",
)
session.run(
"coverage",
"run",
"--append",
"-m",
"unittest",
"discover",
"-s=tests",
"-p",
"*_test.py",
)
session.run(
"coverage", "report", "-m", "--omit=.nox/*,examples/*,*/__init__.py"
)
session.run(*TEST_COMMAND)
session.run(*COVERAGE_COMMAND)

0 comments on commit 71dee33

Please sign in to comment.