I also have a problem with including whole directo...
# general
s
I also have a problem with including whole directory of files to test cases. Tests in
test_end_to_end.py
use files from
_input
directory I have it structured this way:
Copy code
tests
|---_input
   |---file1.csv
   |---file2.csv
|--- test_end_to_end.py
|--- BUILD
And BUILD file looks like this
Copy code
python_sources()

python_tests(
    name = "tests0",
)

files(
    name = "input",
    sources = [
        "_input/*",
    ],
)
And unfortunately this do not work. How should I modify my BUILD file?
c
Add a dependency on your input files from your python tests target:
Copy code
python_tests(..., dependencies=[":input"])
Depending on how you access those files, it may be appropriate to use
resources
rather than
files
target, though.. See https://www.pantsbuild.org/docs/resources for more details..
h
Yep, Pants doesn't currently infer dependencies on resources/files , so you have to add them manually as @curved-television-6568 mentioned
c
There’s an example under the
files
section as well, covering your use case.
👍 1