ambitious-xylophone-5772
10/26/2022, 11:27 PMtests/
- test_a.py
- test_b.py
- BUILD
I want to have a structure like this:
tests/
- test_a.py
- test_b.py
- BUILD
- extra/
- test_c.py
- test_d.py
What do I need to do to have my BUILD pick up the tests in that directory as well?careful-address-89803
10/26/2022, 11:40 PMpython_tests
target in you BUILD file will cause all test-like files to be picked up. ./pants tailor ::
should add onecareful-address-89803
10/26/2022, 11:42 PMpython_tests
target to include both the "//tests/" and "//tests/extra" directories.
I usually let tailor do it, because it's done for me and if I need to modify the BUILD file it's right there.wide-midnight-78598
10/26/2022, 11:47 PM./pants tailor
will basically put a BUILD
file in each of your directories with the python_sources
or python_tests
It's referred to as 111 in the Slacks (though I can never remember why), alluding to 1 BUILD file per directory. Otherwise, you'll need to glob the sources in your BUILD.wide-midnight-78598
10/26/2022, 11:49 PMsources=['**/test_*.py', '**/*_test.py', '**/tests.py']
(or whatever)curved-television-6568
10/27/2022, 12:08 AMambitious-xylophone-5772
10/27/2022, 12:22 AM./pants tailor
… thanks guys!wide-midnight-78598
10/27/2022, 12:27 AMone target per file@curved-television-6568 That can't be right
curved-television-6568
10/27/2022, 12:30 AMhappy-kitchen-89482
10/27/2022, 12:58 AMwide-midnight-78598
10/27/2022, 1:22 AM