|
84 | 84 | s.replace(
|
85 | 85 | ["noxfile.py"],
|
86 | 86 | r'''
|
| 87 | +def default\(session, tests_path\): |
| 88 | + # Install all test dependencies, then install this package in-place. |
| 89 | +
|
| 90 | + constraints_path = str\( |
| 91 | + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" |
| 92 | + \) |
| 93 | + session.install\( |
| 94 | + "mock", |
| 95 | + "asyncmock", |
| 96 | + "pytest", |
| 97 | + "pytest-cov", |
| 98 | + "pytest-asyncio", |
| 99 | + "-c", |
| 100 | + constraints_path, |
| 101 | + \) |
| 102 | +
|
| 103 | + session.install\("-e", ".", "-c", constraints_path\) |
| 104 | +
|
| 105 | + # Run py.test against the unit tests. |
| 106 | + session.run\( |
| 107 | + "py.test", |
| 108 | + "--quiet", |
| 109 | + f"--junitxml={os.path.split\(tests_path\)[-1]}_{session.python}_sponge_log.xml", |
| 110 | + "--cov=db_dtypes", |
| 111 | + "--cov=tests/unit", |
| 112 | + "--cov-append", |
| 113 | + "--cov-config=.coveragerc", |
| 114 | + "--cov-report=", |
| 115 | + "--cov-fail-under=0", |
| 116 | + tests_path, |
| 117 | + *session.posargs, |
| 118 | + \) |
| 119 | +
|
| 120 | +
|
87 | 121 | @nox.session\(python=UNIT_TEST_PYTHON_VERSIONS\)
|
88 | 122 | def unit\(session\):
|
89 | 123 | """Run the unit test suite."""
|
90 | 124 | default\(session\)
|
91 | 125 | ''',
|
92 | 126 | r'''
|
| 127 | +def default(session, tests_path): |
| 128 | + # Install all test dependencies, then install this package in-place. |
| 129 | +
|
| 130 | + constraints_path = str( |
| 131 | + CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt" |
| 132 | + ) |
| 133 | + session.install( |
| 134 | + "mock", |
| 135 | + "asyncmock", |
| 136 | + "pytest", |
| 137 | + "pytest-cov", |
| 138 | + "pytest-asyncio", |
| 139 | + "-c", |
| 140 | + constraints_path, |
| 141 | + ) |
| 142 | +
|
| 143 | + session.install("-e", ".", "-c", constraints_path) |
| 144 | +
|
| 145 | + # Run py.test against the unit tests. |
| 146 | + session.run( |
| 147 | + "py.test", |
| 148 | + "--quiet", |
| 149 | + f"--junitxml={os.path.split(tests_path)[-1]}_{session.python}_sponge_log.xml", |
| 150 | + "--cov=db_dtypes", |
| 151 | + "--cov=tests/unit", |
| 152 | + "--cov-append", |
| 153 | + "--cov-config=.coveragerc", |
| 154 | + "--cov-report=", |
| 155 | + "--cov-fail-under=0", |
| 156 | + tests_path, |
| 157 | + *session.posargs, |
| 158 | + ) |
| 159 | +
|
| 160 | +
|
93 | 161 | def prerelease(session, tests_path):
|
94 | 162 | constraints_path = str(
|
95 | 163 | CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
|
@@ -154,7 +222,7 @@ def prerelease(session, tests_path):
|
154 | 222 | session.run(
|
155 | 223 | "py.test",
|
156 | 224 | "--quiet",
|
157 |
| - f"--junitxml=prerelease_unit_{session.python}_sponge_log.xml", |
| 225 | + f"--junitxml={os.path.split(tests_path)[-1]}_prerelease_{session.python}_sponge_log.xml", |
158 | 226 | "--cov=db_dtypes",
|
159 | 227 | "--cov=tests/unit",
|
160 | 228 | "--cov-append",
|
|
0 commit comments