Skip to content

testspace-samples/python.unittest

 
 

Repository files navigation

Testspace


Python/Unittest sample for demonstrating Testspace based on the test_driven_python repo

Sample demonstrates techniques for using Testspace with Python code and the unittest test framework together with cov-core code coverage tool and nose2 runner.

  • Using a Testspace Project that is connected with this GitHub Repo
  • Using 3 Online CI services for demonstration purposes only
  • Can review the Results at testspace-samples:python.unittest
  • Refer to our Help for more information

Using Multiple Online CI Services:

Build Build Status CircleCI


Publishing Test Content using www.testspace.com.

Space Health Space Metric Space Metric


In order to run this sample you will need a host workstation with installed python 3.8+.

Download and configure the Testspace client

mkdir -p $HOME/bin
curl -s https://testspace-client.s3.amazonaws.com/testspace-linux.tgz | tar -zxvf- -C $HOME/bin
testspace config url samples.testspace.com

Buiding:

sudo pip install -r requirements.txt
sudo apt-get install pylint

Running Static Analysis:

pylint stock_alerter/ -f parseable > analysis.txt

Running Tests with Code Coverage:

nose2 --junit-xml --with-coverage

Push Content using Testspace client

testspace analysis.txt{lint} nose2.xml{stock_alerter} coverage.xml