'Windows/Python: bazel run works fine, bazel test not so much

I have a fairly standard Python test (full sources are here):

from absl.testing import absltest
[...]
class BellTest(absltest.TestCase):  
   def test_bell(self):
   [...]

and the corresponding entries in the BUILD file, where the dependencies are part of the BUILD file:

py_test(
    name = "bell_test",
    size = "small",
    srcs = ["bell_test.py"],
    python_version = "PY3",
    srcs_version = "PY3",
    deps = [
        ":tensor",
        ":state",
        ":ops",
        ":bell",
    ],
)

Without problems I can 'run' this via

bazel run bell_test
[...] comes out Ok.

However, I cannot 'test' it

bazel test bell_test
[...] FAILED

The log file tells me that it cannot find the dependency to absl.testing. This is puzzling, given that it works with 'run'. This also works on Linux and MacOS without problems.

I tried to add all kinds of ways to add a dependency to absl / testing, but to no avail. Pointers would be greatly appreciated.

Side note: It would be great if bazel would print the path to the log file with Windows backslashes!



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source