Closed tommilligan closed 4 years ago
.
always points to runfiles of the tests, so whatever test is included in srcs
will be executed. If you want to limit the tests you want to run, only include those in srcs
You're right that it will execute all tests in srcs
as these are stored in runfiles
, however also included here are files passed in via deps
(and data
I guess, although I haven't tested that).
For my use case specifically, I'm working on a codebase where test files are importing helper functions from another module's test file, and I don't want tests from that external file to be run.
I'd like to customise the arguments that are passed to
pytest
by thepy_pytest_test
rule. My usecase is I only want to test files in a specific directory, and currently the"."
(test this directory) argument is hardcoded.This PR moves the default arguments from
pytest_helper.py
into thedefs.bzl
definition, so they can be overridden. For backwards compatibility, they have been named as a new argument,pytest_args
, rather than justargs
.These can then be adjusted like so: