pip3 install --user pyqt5
sudo apt-get install python3-pyqt5
sudo apt-get install pyqt5-dev-tools
sudo apt-get install qttools5-dev-tools
# Sorry for the scrappiness of this. It's supposed to be scrappy. | |
import time | |
from botocore.exceptions import ClientError | |
import boto3 | |
import boto3.session | |
# boto3.set_stream_logger('') | |
session = boto3.session.Session() | |
s3 = session.client('s3') |
############################################################################### | |
# Install mongoDB Server on Ubuntu 16.04 LTS | |
############################################################################### | |
# Import the Public Key used by the Ubuntu Package Manager | |
apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6 | |
# Create a file list for mongoDB to fetch the current repository | |
echo "deb [ arch=amd64,arm64 ] http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.4 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list |
When you try to remove the docker image with the following command
docker rmi 6795374be8c1
Sometimes you might be facing below error:
Error response from daemon: conflict: unable to delete 6795374be8c1 (cannot be forced) - image has dependent child images
Below is the Docker command line used to find the dependent child images
# Execute the following commands one at a time from a bash prompt. | |
# download docx2txt by Sandeep Kumar | |
wget -O docx2txt.pl http://www.cs.indiana.edu/~kinzler/home/binp/docx2txt | |
# make a wrapper | |
echo '#!/bin/bash | |
docx2txt.pl $1 -' > docx2txt | |
chmod +x docx2txt | |
# make sure docx2txt.pl and docx2txt are your current PATH. Here's a guide |
# Stop all containers | |
docker stop `docker ps -qa` | |
# Remove all containers | |
docker rm `docker ps -qa` | |
# Remove all images | |
docker rmi -f `docker images -qa ` | |
# Remove all volumes |
import mock | |
with mock.patch('path.to.ObjectClass.my_property', new_callable=mock.PropertyMock) as mock_my_property: | |
mock_my_property.return_value = 'my value' |
# -*- coding: utf-8 -*- | |
from __future__ import division | |
from __future__ import absolute_import | |
from __future__ import print_function | |
from __future__ import unicode_literals | |
class Settings(object): | |
def __init__(self): | |
self.settings = dict( |
Using py.test is great and the support for test fixtures is pretty awesome. However, in order to share your fixtures across your entire module, py.test suggests you define all your fixtures within one single conftest.py
file. This is impractical if you have a large quantity of fixtures -- for better organization and readibility, you would much rather define your fixtures across multiple, well-named files. But how do you do that? ...No one on the internet seemed to know.
Turns out, however, you can define fixtures in individual files like this:
tests/fixtures/add.py
import pytest
@pytest.fixture