Skip to content

Commit fbc7cc2

Browse files
committed
Add nox support
1 parent 6fae148 commit fbc7cc2

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

noxfile.py

+31
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,31 @@ def default(session):
4747
)
4848

4949

50+
def run_asyncio_unit_tests(session):
51+
"""Run AsyncIO unit test session."""
52+
53+
# Install all test dependencies, then install this package in-place.
54+
session.install(
55+
"mock", "pytest",
56+
"git+https://github.com/pytest-dev/pytest-asyncio.git", "asyncmock",
57+
"pytest-cov", "grpcio >= 1.0.2")
58+
session.install("-e", ".")
59+
60+
# Run py.test against the unit tests.
61+
session.run(
62+
"py.test",
63+
"--quiet",
64+
"--cov=google.api_core",
65+
"--cov=tests.asyncio",
66+
"--cov-append",
67+
"--cov-config=.coveragerc",
68+
"--cov-report=",
69+
"--cov-fail-under=0",
70+
os.path.join("tests", "asyncio"),
71+
*session.posargs
72+
)
73+
74+
5075
@nox.session(python=["2.7", "3.5", "3.6", "3.7", "3.8"])
5176
def unit(session):
5277
"""Run the unit test suite."""
@@ -63,6 +88,12 @@ def unit_grpc_gcp(session):
6388
default(session)
6489

6590

91+
@nox.session(python=["3.6", "3.7", "3.8"])
92+
def unit_asyncio(session):
93+
"""Run the unit test suite."""
94+
run_asyncio_unit_tests(session)
95+
96+
6697
@nox.session(python="3.6")
6798
def lint(session):
6899
"""Run linters.

0 commit comments

Comments
 (0)