|
81 | 81 | ["noxfile.py"], r"def default\(session\):", "def default(session, tests_path):"
|
82 | 82 | )
|
83 | 83 | s.replace(["noxfile.py"], r'os.path.join\("tests", "unit"\),', "tests_path,")
|
| 84 | +s.replace( |
| 85 | + ["noxfile.py"], |
| 86 | + r'f"--junitxml=unit_{session.python}_sponge_log.xml",', |
| 87 | + r'f"--junitxml={os.path.split\(tests_path\)[-1]}_{session.python}_sponge_log.xml",', |
| 88 | +) |
84 | 89 | s.replace(
|
85 | 90 | ["noxfile.py"],
|
86 | 91 | 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 |
| -
|
121 | 92 | @nox.session\(python=UNIT_TEST_PYTHON_VERSIONS\)
|
122 | 93 | def unit\(session\):
|
123 | 94 | """Run the unit test suite."""
|
124 | 95 | default\(session\)
|
125 | 96 | ''',
|
126 | 97 | 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 |
| -
|
161 | 98 | def prerelease(session, tests_path):
|
162 | 99 | constraints_path = str(
|
163 | 100 | CURRENT_DIRECTORY / "testing" / f"constraints-{session.python}.txt"
|
|
0 commit comments