How to produce HTML unit test output in Python?

I'm looking for any way to display the results of Python unit tests in an HTML summary. There are tools like this for Java and Ruby... haven't yet located any tools that seem to do this for...

Why do assertions in unittest use TestCase.assertEqual not the assert keyword?

Python's built-in unittest module makes assertions with TestCase.assert* methods: class FooTest(TestCase): def test_foo(self): self.assertEqual(1,1) self.assertNotEqual(1,2) ...

Importing module Attribute Error, LPTHW ex47

I'm doing example 47 from "Learn Python the hard way". And this is my code: from nose.tools import* from ex47.game import Room def test_room(): gold = Room("GoldRoom", ...

Jenkins claims build as Unstable though i see it passing

I've a simple Jenkins job where i runt python script to run a bunch of tests. I see the build as UNSTABLE even i see no obvious errors in the Jenkins job as well as no tests failing. Whats i'm...

How can I have nose re-run only tests that failed?

I have some Selenium Webdriver GUI tests that run on every check-in in our Trac/Bitten build environment. For various silly reasons, these are fragile and re-running the failed test always works...

ImportError: No module named matplotlib.pyplot

I am currently practicing matplotlib. This is the first example I practice. #!/usr/bin/python import matplotlib.pyplot as plt radius = [1.0, 2.0, 3.0, 4.0] area = [3.14159, 12.56636, 28.27431,...

Assert that two dictionaries are almost equal

I am trying to assert that two dictionaries are almost equal, but I can't seem to do that. Here is an example: >>> import nose.tools as nt >>> nt.assert_dict_equal({'a' : 12.4}, {'a' : 5.6 +...

ubuntu: uninstall matplotlib with pip won't work

I'm on Ubuntu and I neeed to uninstall matplotlib, which I installed as an ubuntu package and later upgraded with pip. The usual command doesn't work: $ sudo pip uninstall matplotlib Can't...

Laravel/Eloquent: Fatal error: Call to a member function connection() on a non-object

I'm building a package in Laravel 4 but am getting a non-object error when attempting to access the db from which seems to be a properly instantiated object. Here's the setup: The config and class...

Checking flash messages in flask application nose tests

On different input values posted to a url of my flask application, it flashes different messages, e.g. 'no data entered', 'invalid input', 'no record found', '3 records found'. Can someone guide...

Could not find a version that satisfies the requirement <package>

I'm installing several Python packages in Ubuntu 12.04 using the following requirements.txt...

Make pip always install binaries locally in virtualenv with --system-site-packages

I'm using a virutalenv with --system-site-packages so that my builds don't take forever (I'm actually using Docker, so installs to the container environment are cached). Problem is that nose is...

How to suppress py.test internal deprecation warnings

Is there a way to suppress the pytest's internal deprecation warnings? Context: I'm looking to evaluate the difficulty of porting a test suite from nose to pytest. The suite is fairly large and...

Count the smiley faces in an array

Description: Given an array (arr) as an argument complete the function countSmileys that should return the total number of smiling faces. Rules for a smiling face: -Each smiley face must contain a...

Python test fixture to run a single test?

I'm looking for something like ruby rspec's focus metadata or elixir's mix tags to run a single python test. Ruby RSpec Example: # $ rspec spec it 'runs a single test', :focus do expect(2).to...

How to achieve TestNG like feature in Python Selenium or add multiple unit test in one test suite?

Suppose I have this two nosetest ExampleTest1.py and ExampleTest2.py ExampleTest1.py class ExampleTest1(TestBase): """ """ def testExampleTest1(self): ...

how to merge lists from a loop output Python

I'm trying to merge 2 lists output into one list from a for loop. Tried append() and extend() to no avail. Here's my code: c_files = ['file1', 'file2'] doc_count = 0 comb_cran = [] for fname in...

How to fix? ImportError: pycurl: libcurl link-time version is older than compile-time version

I have this error when I run tests on a conda environment which I built from specs in environment.yml File "utils.py", line 5, in <module> import pycurl ImportError: pycurl: libcurl link-time...

ggplot2 scale_fill_gradientn is ignoring specified colours and returning black and white plot

I'm trying to plot the differences in amplitude of a signal using a fill gradient to picture the changes in amplitude across different locations in a head map. The original code was taken from...

PyInstaller Missing Module Errors Even After Including Specifically

Pyinstaller compiles my app into an .exe on Windows fine, but I'm not able to build a working .app on Mac. I've tried --onefile and --onedir, but no dice, the app just opens and then closes...

How can I get the points in face mesh like eye ,eyebrow , lip, mouth ,nose using ARFaceTracking in Swift 4.2?

Currently i am getting the left and right eye points, How can i get the other parts points using ARFaceTracking or other framework in swift 4 in ios. please give the feedback above the questions?

Python: why do I get an error when I import geopandas?

I try to import geopandas in my jupyter notebook. import geopandas as gp and I get the following error: ImportError:...

WEBP support not installed error with Pillow included in Anaconda

I have written a small code to open webp image in the Anaconda prompt. from PIL import Image im = Image.open('test.webp') It causes the following...

PyInstaller: StopIteration Error when I import geopandas

I am trying to execute PyInstaller on a my script. I installed all of the required packages and the .exe is succesfully created. But when I execute it on another machine, I get he Following...

"AssertionError: Torch not compiled with CUDA enabled" in spite upgrading to CUDA version

I figured out this is a popular question, but still I couldn't find a solution for that. I'm trying to run a simple repo Here which uses PyTorch. Although I just upgraded my Pytorch to the latest...

I would like to create a quiz game that picks random question from list without repetition

This code will let 2 players answer a random question from a list then compare their scores. Problems: Questions keep repeating because of randint, tried using random.shuffle — no luck. If I...

Vision Framework (iOS): How are VNDetectFaceLandmarksRequest and VNDetectFaceRectanglesRequest different?

There are two different requests that you can use for face detection tasks with the iOS Vision Framework: VNDetectFaceLandmarksRequest and VNDetectFaceRectanglesRequest. Both of them return an...

How to get 468 face landmarks points using ARCore - IOS

I am using ARCore-IOS to create AR IOS application. https://github.com/google-ar/arcore-ios-sdk/tree/v1.25.0 I am able to get nose, left-forehead and right-forehead region point as well face...

How can I isolate and recolor specific color range?

Given an image of the region containing the lips and other "noise" (teeth, skin), how can we isolate and recolor only the lips (simulating a "lipstick" effect)? Attached is a photo describing the...

Haskell Cartesian Product, Monad with filter

This has to be dead simple and I'm unhappy I can't figure it out at this point in my Haskell experience. I want a cartesian product of a list with itself, but I want to filter out identical items....