Python, unit test - Pass command line arguments to setUp of unittest.TestCase

I have a script that acts as a wrapper for some unit tests written using the Python unittest module. In addition to cleaning up some files, creating an output stream and generating some code, it...

Python: run a unittest.TestCase without calling unittest.main()?

I've written a small test suite in Python's unittest: class TestRepos(unittest.TestCase): @classmethod def setUpClass(cls): """Get repo lists from the svn server.""" ... def...

Python 3 unittest: How to extract results of tests?

I am using Python's (3.4.1) unittest module for my unit tests. I load all my testing module files using imports and then run unittest.main(): import unittest import testing_module1 import...

Travis-CI Error when run test coverage Django Project

This is my first time I use Travis-CI to check my project. I am new in Django. This Django project is not mine, I just fork from another project. I want to put .travis.yml to check the coveralls...

Why can't I look at sys.argv in the class setup

The following code fails to run, but if I remove the line "datafile = sys.argv[1]" it works fine. I invoke the script as: generateTests.py full-path-to-file The error message is below the code...

Can not add the same measure twice on Python unit test report

After upgrade to the following versions: Sonar 5.2 Sonar Runner 2.4 Python Plugin 1.5 my test reports are not being processed correctly when I have more than one test file in the same package, for...

What's the recommended way to import `unittest` or `unittest2` depending on python version

I have this little test.py script I needs to get it running on our CI. In our local machines, most people use python 2.7, so import unittest works. But in the CI, the environment is python 2.6,...

Bundle library to application using pybuilder

I'm new to python and writing an application which I want to package for debian. Therefore, I'd like to (and I have to) use pybuilder. My goal is to create a .deb package (currently using stdeb),...

Running python unit tests and output the results to Jenkins

For a project using Jenkins I would like to be able to run Python Unit tests. These tests contain interactions with an embedded device. The results should be reported back to Jenkins. My current...

executing a testng java test with python for junit results

Hi and thanks in advance, I have several scripts in python(2.7+) which produce junit test results. Currently I am trying to leverage some java testng code. I was wondering if there is a way to use...

Where is the xml file generated saved after running xmlrunner?

I have my unittest suite and this piece of code. Where is the xml file saved? if __name__ == '__main__': unittest.main(verbosity=2,...

How to run Python Unit tests with XML output

I try to run Python unit tests on our continues integration server (Bamboo, running on Debian Jessie) with XML output so we can either mark build as fail or success according to the test results....

passing arguments to unittest.TestSuite and using xmlrunner.XMLTestRunner

I am writing some tests which use the python unittest package (Python 2.7) and I heavily rely on the xmlrunner.XMLTestRunner to dump the XML test output Unfortunately, I fail to find some basic...

Selenium Python PhantomJS screenshot issues

I need some help with a certain website for rendering, I've been trying so hard for making a good screenshot but actually I couldn't, then I noticed that it wasn't my code, it was the html or css,...

How to enable custom test discovery with unittest while using xmlrunner

Im trying to use custom test discovery while using xmlrunner to report my test results in XML format. Could someone kindly explain to me how I can use unittest.TestLoader().discover() properly?...

jenkins root package name change by xmlrunner

I'm using xmlrunner module for python to generate report in xml format for jenkins. And xml output will list the classname & testcase name : testcase classname="FunctionalTest"...

Close CMD window when command executes - Java

I'm using Sikuli to execute my automated tests, and I'm writing a small java app for running my tests. I've searched for other answers but most of them relate to running batch scripts from java, I...

No print to stdout when running xmlrunner in python

I'm using xmlrunner in combination with unittest in python for testing purposes by running xmlrunner.XMLTestRunner(outsuffix="",).run(suite) where suite is standard unittest.suite.TestSuite When I...

Test report is not creating while running from XMLRunner

I am running Unit TestCases from Python Using XMLTestRunner. This is my main file: #LoggingService.py class LoggerWriter: # used to redirect console msgs to the log def write(self,...

Why doesn't Sonar read the format of django-nose coverage results?

When I try to send a python project with sonar-scanner, it throws an exception: Caused by: java.lang.IllegalStateException: Unknown report version: 4.4.2. This parser only handles version 1."....

Python unittest with xmlrunner

Good evening. Have the small problem with python unittest. I need to output tests results to xml file. I did that, but a lost the console outputing. Need to copy results in console + xml output....

Using multiple WebSocket clients inside automated Selenium tests with unittest

I am writing automated UI tests for a specific device, where the UI configurations are transferred to the device from a back-end server as multiple JSON files over websocket connections. At first,...

How to forward port for App testing. Test Droid Cloud

I am trying to run automate tests using Appium on https://cloud.testdroid.com. The Android app is made from Unity3d game engine and is using AltUnityTester...

Django Test : __init__() got an unexpected keyword argument 'failfast'

I've a problem with my Django App, this week I added some models and tests but when I'm about to test it with "python manage.py test", I have this error : TypeError: __init__() got an unexpected...

xmlrunner duplicates print statements for sub tests using unittest

I am using a xml test runner for unittest https://github.com/xmlrunner/unittest-xml-reporting in order to generate XML files that I can pass for Allure framework. In one of my functions I use the...

Azure Pipeline can't find test results files to publish

The task [email protected] doesn't find my test result files. Why not? I am running Python tests with unittest using xmlrunner to generate output files in JUnit format. This is the relevant...

Unable to print logging output using xmlrunner for unittest

I am trying to use xmlrunner to generate a xml of my test result with unittest. I would like the report to include my logging output. But it looks like it doesn't work. For example, in this code,...

Unable to execute docker commands inside jenkins container(docker command not found)

I am running a jenkins container on an EC2 instance and executing a simple pipeline to test and deploy a simple flask application.I am using my git repo which has the Jenkinsfile. Using the...

Python Behave tests not running on bitBucket CI

We have a Simple Python Behave based test suite. It runs fine on local environment. Command used to run test: pip3 install -r requirements.txt behave -D...

ModuleNotFoundError: No module named 'urllib3.packages.six'

I'm not able to run my airflow image. It builds successfully, but when I use docker-compose up and bring up the image, it throws the following error and exits. Unable to load the config, contains...