Configuring wercker.yml to run unit tests in a python app requiring postgres service

I'm trying to use the dockerized version of wercker to run unit tests in a python app but most of my unit tests fail with error sqlalchemy.exc.OperationalError: (psycopg2.OperationalError) could...

Wrapped error with setup_databases for pytest-django

After I added a new class to my models, I am unable to run my tests in my server. The problem is the error message seems to be wrapped and doesn't provide further information about the error. As...

pip install issue - 'utf-8' codec can't decode byte

As you will soon I am really new to Python, and I really need your help to understand the error I am encoutering. I am trying to install some required package from a project (this one) with the...

how to add filter to tweepy stream in an flask socketio application?

With my flask-socketio app, I am trying to update all connected clients when I receive a new tweet. So following is my code. from tweepy.streaming import StreamListener from tweepy import...

Database for Pytest Flask application does not work correctly

I got a flask app and trying to test it with pytest. The question is how to make the base create a new one for each test function? This is how I think it should work. This is my...

Pytest: setup testclient and DB

I'm trying to learn something about testing my flask app. In order to do that, I am using pytest and sqlalchemy. I want to test a template, whose delivers route some SQL content. So in my opinion...

django 2.1.4 migration fails with "DETAIL: Key columns "xxx" and "yyy" are of incompatible types: integer and character varying"

I'm trying to upgrade a django 1.11 based service to latest django 2.1.4. When running migrations ( during unit testing ) I now get the following error in an existing migration of my django...

AWS beanstalk deployment failed with exit status 1

I've been trying for several days now to set up Django under Amazon Web Services' Elastic Beanstalk. I am getting a following error most of the time: ERROR: Your requirements.txt is invalid....

Docker error in running postgres connection string (for SQLAlchemy) with sslmode

I have a python app the connects to AWS RDS. The connection string allows me to run the app in a Docker with no issues: postgresql://<usr>:<pwd>@<svr>/<db> The following 2 connection strings...

How do I fix IntegrityErrors during the Django TestCase teardown?

I'm porting a large webapp from Python 2.7 to Python 3.6. I have managed the database migrations and converted the code using 2to3, but I'm having problems running my testing suite. For a large...

I am getting fixture error when running python selenium scripts from command line

I am in the process of creating an automation framework using selenium and python so in my conftest.py file I have used fixtures but when I am running my test cases through cmd line I am getting...

pytest strange behavior with setup() function

I observe the implicit behavior of pytest when calling a function called setup(). import pytest def config(): login = 'John' password = '123' env = 'staging' return login,...

Put an existing Flask App in a docker container - pip import problem

I am starting to play with docker and I decided to try and "dockerize" a flask app that I am building. but when I run docker build -t test . I get the exception, listed below. When running this...

LDAP server down "Multi Stage Docker Build"

I am building a multi stage docker for my app, using an official python image "python:3.7-buster", nginx, supervisord and uwsgi. The image build is successful and i can check routes that don't use...

Flask error - TypeError: 'NoneType' object is not subscriptable

Please I am getting two errors when I run my application. This is a simple app that displays data from my database. Please help me to resolve this problem. See my code below: import pymongo from...

My scripts are running very slow in Pycharm

I recently started using Python with selenium and Pycharm as editor. When I run a small script just to fill in email fields and click next button. To perform those 3 steps it took nearly 25 secs....

dockerpy not able to connect to docker daemon inside bit bucket container

I have the below simple script which is basically to test whether https://github.com/docker/docker-py is able to run commands inside bitbucket containers: import docker CLIENT =...