Getting error ImportMismatchError while running py.test

后端 未结 6 1641
不知归路
不知归路 2021-01-31 07:20

When I am running tests locally its working fine, but after creating the docker and running inside the container I am getting below error.

    /usr/local/lib/pyt         


        
6条回答
  •  再見小時候
    2021-01-31 07:30

    I have fixed it by removing all __pycache__ pkg under test/ directory, the issue was when I was creating docker image its picking all my __pycache__ and *.pyc files too, at the time when test are running its using my local machine path instead of the path in docker container.

    Conclusion: Clear your *.pyc and __pycache__ files before creating a docker image.

提交回复
热议问题