@@ -47,6 +47,31 @@ def default(session):
47
47
)
48
48
49
49
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
+
50
75
@nox .session (python = ["2.7" , "3.5" , "3.6" , "3.7" , "3.8" ])
51
76
def unit (session ):
52
77
"""Run the unit test suite."""
@@ -63,6 +88,12 @@ def unit_grpc_gcp(session):
63
88
default (session )
64
89
65
90
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
+
66
97
@nox .session (python = "3.6" )
67
98
def lint (session ):
68
99
"""Run linters.
0 commit comments