You can use SQLAlchemy for this. Just plug in your connection string into the create_engine string and create a fixture for the connection (and session) like this:
engine = create_engine('your connection string goes here with your login creds')
@pytest.fixture(scope='module')
def connection():
connection = engine.connect()
yield connection
connection.close()
You can read more about the cx_Oracle connection engine from the SQLAlchemy docs here:
Location
Your create_engine might look something like this:
engine = create_engine("oracle+cx_oracle://<username>:<password>@(DESCRIPTION = (LOAD_BALANCE=on) (FAILOVER=ON) (ADDRESS = (PROTOCOL = TCP)(HOST = <host>)(PORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = devdb)))")
Which was pulled from this post