Hey folks - wondering if anyone would know why `py...
# development
m
Hey folks - wondering if anyone would know why
pytest
run outputs differ between a Docker environment and local environment? Namely, in Docker the test summary is very terse and it prints a coverage report, whereas in Local it prints PASS/FAIL per unit test and it does not print a coverage report. I find this very odd, I'm installing pytest from a resolve file so the version should be pinned on both environments.
h
Do you have different pants config in each environment? For example, do you have a local
.pants.rc
or
~/.pants.rc
or
/etc/pantsrc
in one but not the other?
m
Hi Benjy, I don't use those files, the only change I apply is switching these lines in
pants.toml
Copy code
[environments-preview.names]
#pytest_env = "//src/tests:python3_docker"
pytest_env = "//src/tests:local_os"
And my contents of the
src/tests/BUILD
are:
Copy code
python_tests(
    name="unittests",
    environment="pytest_env",
)

local_environment(
    name="local_os"
)

docker_environment(
  name="python3_docker",
  platform="linux_x86_64",
  image="<http://docker.io/library/python:3.12-slim|docker.io/library/python:3.12-slim>"
)
Is there a way I can (a) establish the versions of the packages used in each environment? i.e. coverage, pytest, etc. and (b) the execution command used to run the tests?