When I run pytest --collect-only to get the list of my tests, I get them in a format like <Function: test_whatever>. However, when I use pytest -k ... to run a specific test, I need to input the "address" of the test in the format foo::test_whatever. Is it possible to get a list of all the addresses of all the tests in the same format that -k takes?
If you are using -k switch, you don't need to specify the full path separated by colons. If the path is unique, you can use just part of the path. You need full path of tests only when you are not using -k switch.
e.g. 
pytest -k "unique_part_of_path_name"
for pytest tests/a/b/c.py::test_x, you can use pytest -k "a and b and c and x". 
You can use boolean logic for -k switch.
BTW, pytest --collect-only does give the file name of the test in <Module line just above the test names of the file.
Pytest: Getting addresses of all tests