Skip to content

Commit 43e2a1d

Browse files
committed
Configure pants so it can use pytest
1 parent 0fc59f7 commit 43e2a1d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

pants.toml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,27 @@ extra_requirements = [
144144
]
145145
config = "lint-configs/python/.flake8"
146146

147+
[pytest]
148+
lockfile = "lockfiles/pytest.lock"
149+
version = "pytest==7.0.1" # copied from https://www.pantsbuild.org/v2.14/docs/reference-pytest#version
150+
extra_requirements.add = [
151+
"pytest-benchmark[histogram]==3.4.1", # used for st2common/benchmarks
152+
#"pytest-timer[colorama]", # report test timing (--with-timer ala nose-timer)
153+
"pytest-icdiff", # make diff output easier to read
154+
"pygments", # highlight code in tracebacks
155+
156+
# other possible plugins
157+
#"pytest-timeout", # time limit on tests
158+
#"pytest-mock", # more convenient mocking
159+
160+
# included by default with pants
161+
#"pytest-cov", # coverage
162+
#"pytest-xdist", # parallel test runs (pants uses this if [pytest].xdist_enabled)
163+
]
164+
args = [
165+
"--no-header", # don't print pytest version for every tested file
166+
]
167+
execution_slot_var = "ST2TESTS_PARALLEL_SLOT"
168+
147169
[regex-lint]
148170
config = "@lint-configs/regex-lint.yaml"

0 commit comments

Comments
 (0)