@@ -307,4 +307,49 @@ def prerelease_deps\(session, protobuf_implementation\):""",
307
307
def prerelease_deps(session, protobuf_implementation, database_dialect):""" ,
308
308
)
309
309
310
+
311
+ mockserver_test = """
312
+ @nox.session(python=DEFAULT_MOCK_SERVER_TESTS_PYTHON_VERSION)
313
+ def mockserver(session):
314
+ # Install all test dependencies, then install this package in-place.
315
+
316
+ constraints_path = str(
317
+ CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
318
+ )
319
+ # install_unittest_dependencies(session, "-c", constraints_path)
320
+ standard_deps = UNIT_TEST_STANDARD_DEPENDENCIES + UNIT_TEST_DEPENDENCIES
321
+ session.install(*standard_deps, "-c", constraints_path)
322
+ session.install("-e", ".", "-c", constraints_path)
323
+
324
+ # Run py.test against the mockserver tests.
325
+ session.run(
326
+ "py.test",
327
+ "--quiet",
328
+ f"--junitxml=unit_{session.python}_sponge_log.xml",
329
+ "--cov=google",
330
+ "--cov=tests/unit",
331
+ "--cov-append",
332
+ "--cov-config=.coveragerc",
333
+ "--cov-report=",
334
+ "--cov-fail-under=0",
335
+ os.path.join("tests", "mockserver_tests"),
336
+ *session.posargs,
337
+ )
338
+
339
+ """
340
+
341
+ place_before (
342
+ "noxfile.py" ,
343
+ "def install_systemtest_dependencies(session, *constraints):" ,
344
+ mockserver_test ,
345
+ escape = "()_*:" ,
346
+ )
347
+
348
+ place_before (
349
+ "noxfile.py" ,
350
+ "UNIT_TEST_PYTHON_VERSIONS: List[str] = [" ,
351
+ 'DEFAULT_MOCK_SERVER_TESTS_PYTHON_VERSION = "3.12"' ,
352
+ escape = "[]" ,
353
+ )
354
+
310
355
s .shell .run (["nox" , "-s" , "blacken" ], hide_output = False )
0 commit comments