I am unable to run my unit tests in Python3.7/pytest. The app is a flask-restplus application, and I am using sqlalchemy and psycopg2 to interact with a PostgreSQL10 database. This code used to work before updating my system. After running brew update
and brew upgrade
awhile back, openssl was installed as openssl@1.1 and specifically openssl@1.1.1b. The exact error I receive is
E ImportError: dlopen(/Users/myuser/myproject/.tox/dev/lib/python3.7/site-packages/psycopg2/_psycopg.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libssl.1.1.dylib
E Referenced from: /Users/myuser/myproject/.tox/dev/lib/python3.7/site-packages/psycopg2/_psycopg.cpython-37m-darwin.so
E Reason: image not found
Also, I am running OSX Mojave version 10.14.4.
I have tried symlinking the library and reinstalling openssl as well as the other methods as mentioned here: psycopg2 installation error - Library not loaded: libssl.dylib. Note that I changed the openssl version in the symlink to 1.1 instead of 1.0 but that still did not fix the situation.
I expect the tests to pass (they do on coworkers setup, which is the same MacBook, OS Version and homebrew setup), but any test that has any interaction with the database fails with the above error.