UserWarning: Module _mysql was already imported from /usr/lib/pymodules/python2.6/_mysql.so

I have deployed a django project on a server running under debian lenny. Every time it starts up the following warning pops...

Setup Apache2 mod_wsgi for sentry

I already used sentry 8.1 that installed on a virtualenv by below apache configs: <VirtualHost x.x.x.x:80> WSGIDaemonProcess sentry...

Django cookiecutter with Docker add pip package

I have created a Django project with cookiecutter-django by PyDanny with Docker. This is inside a virtualenvwrapper and I use docker-compose. No I am trying to install a package...

pytest-xdist IOError: cannot send to <Channel id=1 closed>

I'm using pytest with pytest-xdist to test django app,when i run py.test -n 1 i get an error: Test session starts (platform: linux2, Python 2.7.12, pytest 2.9.2, pytest-sugar 0.7.1) django...

flask web server not starting in travis-ci in dual python environments

I want to integrate my project into Travis-CI. My project involved a Flask web-server in Python with a postgresql database. All my tests use a web server running in debug mode. I'm trying to...

Python3 + pytest + pytest-mock: Mocks leaking into other test functions breaking assertions?

NOTE: All Details about my setup (python version, modules etc) listed at bottom of question. Apologies in advance if this issue is blatant, but i've been wrestling with it for several days now....

tox command fails but full command works manually

I have a tox env called unit_tests that I use to try to execute tests with pytest_django. When called the command tox -e unit_tests I get the InvocationError below. If I copy and paste the command...

'pipenv install -r' is not working

Excuted this : 'pipenv install -r requirements/local.txt' D:\doc\jaeeongram> pipenv install -r requirements/local.txt Requirements file provided! Importing into Pipfile… Pipfile.lock not found,...

How execute pytest-test cases with GUI

I'm trying to find a way to execute test-cases with help of Graphical user interface in Pytest. I found few plugins like Pytest-sugar which displays failed/passed status only. But I actually need...

Django Deploy to Heroku "Six" / "django-appconf" issue

I am a complete beginner, but I have created a small website using Python / Django with the help of django-cookiecutter, including the deploy to Heroku instructions. I am in the process of...

OSX ld: library not found for -lssl

I am trying to install mysqlclient in virtrualenv on OSX high sierra, with python 3. And got the following error: Failed building wheel for mysqlclient Running setup.py clean for...

Python test run under Pytest does not catch CalledProcessError exceptions correctly

I am at the moment facing a weird behaviour when running Python doctests in Pytest (py.test). The following snippet highlights the bevaviour. The doctests do pass when the script is invoked via...

ModuleNotFoundError: No module named

In conftest.py I am loading the module blueprint.Manifest, which in turn loads the module Head for example. Please see minimal example at the bottom of the description. But I get the following...

Pytest-xdist works with pip but not with pipenv. No tests are loaded/scheduled

Pytest works when I have it installed through pip and pipenv. However, when using the pytest-xdist plugin with the command e.g pytest -n 4, this only works with pip and not pipenv. No tests are...

Can't install any pip package within my docker environment, since it won't be recognized

I am running a Cookiecutter django project in a docker environment and I would like to add new packages via pip. Specifically I want to add: djangorestframework-jwt When I do: docker-compose -f...

subprocess.Popen("pytest") returns 2 although pytest returns 1

I'm running pytest from a subprocess.Popen. As can be seen from the code below and it's output, the pytest exits with exit code 1 but the process thinks it exited with exit code 2. Why? (currently...

Python: Mock ImportError with pytest.fixture

I'm trying to make tests on a helper function that reacts on import success or not. The success test is working but not the failing one, do you know why ? The helper...

How can I mock ECS with moto?

I want to create a mock ECS cluster, but it seems not to work properly. Although something is mocked (I don't get a credentials error), it seems not to "save" the cluster. How can I create a mock...

DjangoCMS TypeError: from_db_value() missing 1 required positional argument: 'context' after upgrade to 3.7.2 w/ Django 3.0.1

I had a working DjangoCMS application running DjangoCMS 3.7.1 and Django 2.2, however after I just bumped the DjangoCMS version to 3.7.2 and with it, Django to 3.0.1, I am now getting a render...

pytest-dependency is not working in my test

There are 2 files, the code in the first one is: import pytest class TestXdist2(): @pytest.mark.dependency(name="aa") def test_t1(self): print("\ntest_1") assert True the...

How to run one specific test by using tox?

This is the path to the project D:\QA\test-framework\python-client This is a test frame work implemented by python This is the python file that contains tests This is the path to the test case...