SlideShare una empresa de Scribd logo
1 de 12
Descargar para leer sin conexión
Python-nose: A unittest-based testing framework
for Python that makes writing and running tests
                     easier

                   Timo Stollenwerk


                    April 27th, 2009




             Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Introduction




      Usually: Write unit tests with boilerplate code
      Automated test discovery and running process for unittest
      Intended to mimic the behavior of py.test




                     Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Installation




   $ e a s y _ i n s t a l l nose




                         Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Egg Installation


  setup.py
  ...
  setup (
       ...
      t e s t _ s u i t e =' n o s e . c o l l e c t o r ' ,
      t e s t _ r e q u i r e s =[ ' nose ' ] ,
      i n s t a l l _ r e q u i r e s =[
              ...
              ' nose ' ,
          ],
       ...
  )



                           Timo Stollenwerk    Python-nose: A unittest-based testing framework for Pytho
Basic Usage




  nosetests [options] [(optional) test les or directories]
  Options
       Test selection (path, package, function, etc.)
       Run only tests with certain attributes
       PDB
       Plugins




                        Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Basic Usage: Conguration




   /.noserc
  [ nosetests ]
  v e r b o s i t y =3
  with − d o c t e s t =1
  d o c t e s t − e x t e n s i o n =. t x t




                             Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Writing Unit Tests



  Simplest possible failing test:
  def test ( ) :
      assert False

  And the simplest passing test:
  def test ( ) :
      pass




                        Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Example Unit Tests


  from l x m l i m p o r t o b j e c t i f y

  c l a s s TestTransform ( ) :

        d e f setUp ( s e l f ) :
              from html2docbook i m p o r t Html2DocBook
              h2d = Html2DocBook ( )
              s e l f . h2d = h2d

        def test_paragraphs ( s e l f ) :
            html = 'plorem /ppipsum /p'
            e x p e c t = ' s e c t i o n paralorem /paraparai
            xml = s e l f . h2d . t r a n s f o r m ( html )
            a s s e r t xml == e x p e c t

                         Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Automate your Unit tests with Nose




      nosy.py
      Every time you change any .py le, it runs tests




                     Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Automate your Unit tests with Nose and Eclipse



      Go to the project properties
      Dene a new programbuilder
      Set the location to the nosetest script
      Set the working directory to the project location
      ${workspace_loc:/html2docbook}
      Optional: append any command line options you want
      Go to the build optionstag and tick the launch in
      backgroundänd during auto builds.




                     Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Conclusion




      Nose makes it easier to write and run useful tests.
      Useful tests make it easier to write less code and better code.




                      Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho
Futher Information



      Nose: http://code.google.com/p/python-nose/
      nosy.py: http://jeffwinkler.net/2006/04/27/
      keeping-your-nose-green/
      Automated python testing with nose and eclipse:
      http://www.machine-envy.com/blog/2006/07/29/
      automated-python-testing-with-nose-and-eclipse/
      Pycon 2008 Talk: Testing for the lazy coder
      http://us.pycon.org/common/2008/talkdata/
      PyCon2008/079/nose_pycon08.pdf




                     Timo Stollenwerk   Python-nose: A unittest-based testing framework for Pytho

Más contenido relacionado

La actualidad más candente

Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytestHector Canto
 
Python testing using mock and pytest
Python testing using mock and pytestPython testing using mock and pytest
Python testing using mock and pytestSuraj Deshmukh
 
Testes pythonicos com pytest
Testes pythonicos com pytestTestes pythonicos com pytest
Testes pythonicos com pytestviniciusban
 
Google C++ Testing Framework in Visual Studio 2008
Google C++ Testing Framework in Visual Studio 2008Google C++ Testing Framework in Visual Studio 2008
Google C++ Testing Framework in Visual Studio 2008Andrea Francia
 
Python Testing Fundamentals
Python Testing FundamentalsPython Testing Fundamentals
Python Testing Fundamentalscbcunc
 
Py.test
Py.testPy.test
Py.testsoasme
 
20111018 boost and gtest
20111018 boost and gtest20111018 boost and gtest
20111018 boost and gtestWill Shen
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkArulalan T
 
Automated testing in Python and beyond
Automated testing in Python and beyondAutomated testing in Python and beyond
Automated testing in Python and beyonddn
 
Keep your repo clean
Keep your repo cleanKeep your repo clean
Keep your repo cleanHector Canto
 
Python Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modulesPython Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modulesP3 InfoTech Solutions Pvt. Ltd.
 
Automated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationAutomated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationBarbara Jones
 
Flex Unit 4 Feature Overview
Flex Unit 4 Feature OverviewFlex Unit 4 Feature Overview
Flex Unit 4 Feature Overviewjeff tapper
 
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksSelenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksLohika_Odessa_TechTalks
 
Test Driven Development with PHPUnit
Test Driven Development with PHPUnitTest Driven Development with PHPUnit
Test Driven Development with PHPUnitMindfire Solutions
 
Test your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceTest your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceSebastian Marek
 

La actualidad más candente (20)

Effective testing with pytest
Effective testing with pytestEffective testing with pytest
Effective testing with pytest
 
Python testing using mock and pytest
Python testing using mock and pytestPython testing using mock and pytest
Python testing using mock and pytest
 
Testes pythonicos com pytest
Testes pythonicos com pytestTestes pythonicos com pytest
Testes pythonicos com pytest
 
Google C++ Testing Framework in Visual Studio 2008
Google C++ Testing Framework in Visual Studio 2008Google C++ Testing Framework in Visual Studio 2008
Google C++ Testing Framework in Visual Studio 2008
 
Python Testing Fundamentals
Python Testing FundamentalsPython Testing Fundamentals
Python Testing Fundamentals
 
Py.test
Py.testPy.test
Py.test
 
20111018 boost and gtest
20111018 boost and gtest20111018 boost and gtest
20111018 boost and gtest
 
Testing in-python-and-pytest-framework
Testing in-python-and-pytest-frameworkTesting in-python-and-pytest-framework
Testing in-python-and-pytest-framework
 
Python Programming Essentials - M39 - Unit Testing
Python Programming Essentials - M39 - Unit TestingPython Programming Essentials - M39 - Unit Testing
Python Programming Essentials - M39 - Unit Testing
 
PHPUnit
PHPUnitPHPUnit
PHPUnit
 
Automated testing in Python and beyond
Automated testing in Python and beyondAutomated testing in Python and beyond
Automated testing in Python and beyond
 
Keep your repo clean
Keep your repo cleanKeep your repo clean
Keep your repo clean
 
Introduzione al TDD
Introduzione al TDDIntroduzione al TDD
Introduzione al TDD
 
Python Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modulesPython Programming Essentials - M25 - os and sys modules
Python Programming Essentials - M25 - os and sys modules
 
Automated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and ValidationAutomated Python Test Frameworks for Hardware Verification and Validation
Automated Python Test Frameworks for Hardware Verification and Validation
 
Flex Unit 4 Feature Overview
Flex Unit 4 Feature OverviewFlex Unit 4 Feature Overview
Flex Unit 4 Feature Overview
 
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalksSelenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
Selenium with py test by Alexandr Vasyliev for Lohika Odessa Python TechTalks
 
Test Driven Development with PHPUnit
Test Driven Development with PHPUnitTest Driven Development with PHPUnit
Test Driven Development with PHPUnit
 
Golang dot-testing-lite
Golang dot-testing-liteGolang dot-testing-lite
Golang dot-testing-lite
 
Test your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practiceTest your code like a pro - PHPUnit in practice
Test your code like a pro - PHPUnit in practice
 

Destacado

Unit Testing with Python
Unit Testing with PythonUnit Testing with Python
Unit Testing with PythonMicroPyramid .
 
Python Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit TestingPython Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit TestingPython Ireland
 
TDD in Python With Pytest
TDD in Python With PytestTDD in Python With Pytest
TDD in Python With PytestEddy Reyes
 
2014/07/07 Software Testing - Truong Anh Hoang
2014/07/07 Software Testing - Truong Anh Hoang 2014/07/07 Software Testing - Truong Anh Hoang
2014/07/07 Software Testing - Truong Anh Hoang Vu Hung Nguyen
 
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...Ho Chi Minh City Software Testing Club
 
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...Ho Chi Minh City Software Testing Club
 
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...Ho Chi Minh City Software Testing Club
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...Ho Chi Minh City Software Testing Club
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiHo Chi Minh City Software Testing Club
 

Destacado (20)

Unit Testing with Python
Unit Testing with PythonUnit Testing with Python
Unit Testing with Python
 
Python Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit TestingPython Ireland Nov 2010 Talk: Unit Testing
Python Ireland Nov 2010 Talk: Unit Testing
 
TDD in Python With Pytest
TDD in Python With PytestTDD in Python With Pytest
TDD in Python With Pytest
 
2014/07/07 Software Testing - Truong Anh Hoang
2014/07/07 Software Testing - Truong Anh Hoang 2014/07/07 Software Testing - Truong Anh Hoang
2014/07/07 Software Testing - Truong Anh Hoang
 
Web API Test Automation Using Frisby & Node.js
Web API Test Automation Using Frisby  & Node.jsWeb API Test Automation Using Frisby  & Node.js
Web API Test Automation Using Frisby & Node.js
 
Common Web UI Problems Transforming Manual to Automation
Common Web UI Problems Transforming Manual to Automation Common Web UI Problems Transforming Manual to Automation
Common Web UI Problems Transforming Manual to Automation
 
Security testing-What can we do - Trinh Minh Hien
Security testing-What can we do - Trinh Minh HienSecurity testing-What can we do - Trinh Minh Hien
Security testing-What can we do - Trinh Minh Hien
 
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
[HCMC STC Jan 2015] Making IT Count – Agile Test Metrics
 
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
A Novel Approach of Automation Test for Software Monitoring Solution - Tran S...
 
[HCMC STC Jan 2015] Practical Experiences In Test Automation
[HCMC STC Jan 2015] Practical Experiences In Test Automation[HCMC STC Jan 2015] Practical Experiences In Test Automation
[HCMC STC Jan 2015] Practical Experiences In Test Automation
 
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
Deliver Fast, Break Nothing Via Effective Building Developer and Tester Colla...
 
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
[HCMC STC Jan 2015] FATS: A Framework For Automated Testing Scenarios
 
Agile Testing - Not Just Tester’s Story _ Dang Thanh Long
Agile Testing - Not Just Tester’s Story _ Dang Thanh LongAgile Testing - Not Just Tester’s Story _ Dang Thanh Long
Agile Testing - Not Just Tester’s Story _ Dang Thanh Long
 
Building an effective mobile testing strategy
Building an effective mobile testing strategyBuilding an effective mobile testing strategy
Building an effective mobile testing strategy
 
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
The New Agile Testing Quadrants: Bringing Skilled Testers and Developers Toge...
 
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
A Universal Automation Framework based on BDD Cucumber and Ruby on Rails - Ph...
 
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang MinhTest Design with Action-based Testing Methodology - Ngo Hoang Minh
Test Design with Action-based Testing Methodology - Ngo Hoang Minh
 
Analytical Risk-based and Specification-based Testing - Bui Duy Tam
Analytical Risk-based and Specification-based Testing - Bui Duy TamAnalytical Risk-based and Specification-based Testing - Bui Duy Tam
Analytical Risk-based and Specification-based Testing - Bui Duy Tam
 
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
[HCMC STC Jan 2015] Risk-Based Software Testing Approaches
 
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang PhiIntroduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
Introduction to Back End Automation Testing - Nguyen Vu Hoang, Hoang Phi
 

Similar a Python-nose: A unittest-based testing framework for Python that makes writing and running tests easier

Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Edureka!
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshopamptiny
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suiteericholscher
 
ZCA: A component architecture for Python
ZCA: A component architecture for PythonZCA: A component architecture for Python
ZCA: A component architecture for PythonTimo Stollenwerk
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneVincenzo Barone
 
Plone testingdzug tagung2010
Plone testingdzug tagung2010Plone testingdzug tagung2010
Plone testingdzug tagung2010Timo Stollenwerk
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in pythonJimmy Lai
 
Pynvme introduction
Pynvme introductionPynvme introduction
Pynvme introductionCrane Chu
 
Python Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & styleKevlin Henney
 
Sour Pickles
Sour PicklesSour Pickles
Sour PicklesSensePost
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MoreMatt Harrison
 
Pemrograman Python untuk Pemula
Pemrograman Python untuk PemulaPemrograman Python untuk Pemula
Pemrograman Python untuk PemulaOon Arfiandwi
 
Python Interview Questions And Answers 2019 | Edureka
Python Interview Questions And Answers 2019 | EdurekaPython Interview Questions And Answers 2019 | Edureka
Python Interview Questions And Answers 2019 | EdurekaEdureka!
 

Similar a Python-nose: A unittest-based testing framework for Python that makes writing and running tests easier (20)

Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
Advanced Python Tutorial | Learn Advanced Python Concepts | Python Programmin...
 
20120314 changa-python-workshop
20120314 changa-python-workshop20120314 changa-python-workshop
20120314 changa-python-workshop
 
Making the most of your Test Suite
Making the most of your Test SuiteMaking the most of your Test Suite
Making the most of your Test Suite
 
ZCA: A component architecture for Python
ZCA: A component architecture for PythonZCA: A component architecture for Python
ZCA: A component architecture for Python
 
Where's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind PloneWhere's the source, Luke? : How to find and debug the code behind Plone
Where's the source, Luke? : How to find and debug the code behind Plone
 
Pythonpresent
PythonpresentPythonpresent
Pythonpresent
 
biopython, doctest and makefiles
biopython, doctest and makefilesbiopython, doctest and makefiles
biopython, doctest and makefiles
 
Plone testingdzug tagung2010
Plone testingdzug tagung2010Plone testingdzug tagung2010
Plone testingdzug tagung2010
 
Software development practices in python
Software development practices in pythonSoftware development practices in python
Software development practices in python
 
UPC Testing talk 2
UPC Testing talk 2UPC Testing talk 2
UPC Testing talk 2
 
Plone Einführung
Plone EinführungPlone Einführung
Plone Einführung
 
Mufix Network Programming Lecture
Mufix Network Programming LectureMufix Network Programming Lecture
Mufix Network Programming Lecture
 
Pynvme introduction
Pynvme introductionPynvme introduction
Pynvme introduction
 
Python Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & stylePython Foundation – A programmer's introduction to Python concepts & style
Python Foundation – A programmer's introduction to Python concepts & style
 
Sour Pickles
Sour PicklesSour Pickles
Sour Pickles
 
PyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and MorePyCon 2013 : Scripting to PyPi to GitHub and More
PyCon 2013 : Scripting to PyPi to GitHub and More
 
Pemrograman Python untuk Pemula
Pemrograman Python untuk PemulaPemrograman Python untuk Pemula
Pemrograman Python untuk Pemula
 
Python Interview Questions And Answers 2019 | Edureka
Python Interview Questions And Answers 2019 | EdurekaPython Interview Questions And Answers 2019 | Edureka
Python Interview Questions And Answers 2019 | Edureka
 
05 python.pdf
05 python.pdf05 python.pdf
05 python.pdf
 
Pyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdfPyhton-1a-Basics.pdf
Pyhton-1a-Basics.pdf
 

Más de Timo Stollenwerk

German Aerospace Center (DLR) Web Relaunch
German Aerospace Center (DLR) Web RelaunchGerman Aerospace Center (DLR) Web Relaunch
German Aerospace Center (DLR) Web RelaunchTimo Stollenwerk
 
Performance Testing (Python Barcamp Cologne 2020)
Performance Testing (Python Barcamp Cologne 2020)Performance Testing (Python Barcamp Cologne 2020)
Performance Testing (Python Barcamp Cologne 2020)Timo Stollenwerk
 
Roadmap to a Headless Plone
Roadmap to a Headless PloneRoadmap to a Headless Plone
Roadmap to a Headless PloneTimo Stollenwerk
 
Plone.restapi - a bridge to the modern web
Plone.restapi - a bridge to the modern webPlone.restapi - a bridge to the modern web
Plone.restapi - a bridge to the modern webTimo Stollenwerk
 
The Butler and The Snake (Europython 2015)
The Butler and The Snake (Europython 2015)The Butler and The Snake (Europython 2015)
The Butler and The Snake (Europython 2015)Timo Stollenwerk
 
Hypermedia APIs mit Javascript und Python
Hypermedia APIs mit Javascript und PythonHypermedia APIs mit Javascript und Python
Hypermedia APIs mit Javascript und PythonTimo Stollenwerk
 
Plone Testing & Continuous Integration Team Report 2014
Plone Testing & Continuous Integration Team Report 2014Plone Testing & Continuous Integration Team Report 2014
Plone Testing & Continuous Integration Team Report 2014Timo Stollenwerk
 
The Beauty and the Beast - Modern Javascript Development with AngularJS and P...
The Beauty and the Beast - Modern Javascript Development with AngularJS and P...The Beauty and the Beast - Modern Javascript Development with AngularJS and P...
The Beauty and the Beast - Modern Javascript Development with AngularJS and P...Timo Stollenwerk
 
The Butler and the Snake - JCICPH
The Butler and the Snake - JCICPHThe Butler and the Snake - JCICPH
The Butler and the Snake - JCICPHTimo Stollenwerk
 
The Butler and the Snake - Continuous Integration for Python
The Butler and the Snake - Continuous Integration for PythonThe Butler and the Snake - Continuous Integration for Python
The Butler and the Snake - Continuous Integration for PythonTimo Stollenwerk
 
Who let the robot out? Qualitativ hochwertige Software durch Continuous Integ...
Who let the robot out? Qualitativ hochwertige Software durch Continuous Integ...Who let the robot out? Qualitativ hochwertige Software durch Continuous Integ...
Who let the robot out? Qualitativ hochwertige Software durch Continuous Integ...Timo Stollenwerk
 
Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...Timo Stollenwerk
 
The Future Is Written - Building next generation Plone sites with plone.app.c...
The Future Is Written - Building next generation Plone sites with plone.app.c...The Future Is Written - Building next generation Plone sites with plone.app.c...
The Future Is Written - Building next generation Plone sites with plone.app.c...Timo Stollenwerk
 
Einführung Test-driven Development
Einführung Test-driven DevelopmentEinführung Test-driven Development
Einführung Test-driven DevelopmentTimo Stollenwerk
 

Más de Timo Stollenwerk (20)

German Aerospace Center (DLR) Web Relaunch
German Aerospace Center (DLR) Web RelaunchGerman Aerospace Center (DLR) Web Relaunch
German Aerospace Center (DLR) Web Relaunch
 
Performance Testing (Python Barcamp Cologne 2020)
Performance Testing (Python Barcamp Cologne 2020)Performance Testing (Python Barcamp Cologne 2020)
Performance Testing (Python Barcamp Cologne 2020)
 
Python & JavaScript
Python & JavaScriptPython & JavaScript
Python & JavaScript
 
Roadmap to a Headless Plone
Roadmap to a Headless PloneRoadmap to a Headless Plone
Roadmap to a Headless Plone
 
Plone.restapi - a bridge to the modern web
Plone.restapi - a bridge to the modern webPlone.restapi - a bridge to the modern web
Plone.restapi - a bridge to the modern web
 
Divide et impera
Divide et imperaDivide et impera
Divide et impera
 
The Butler and The Snake (Europython 2015)
The Butler and The Snake (Europython 2015)The Butler and The Snake (Europython 2015)
The Butler and The Snake (Europython 2015)
 
Hypermedia APIs mit Javascript und Python
Hypermedia APIs mit Javascript und PythonHypermedia APIs mit Javascript und Python
Hypermedia APIs mit Javascript und Python
 
Plone Testing & Continuous Integration Team Report 2014
Plone Testing & Continuous Integration Team Report 2014Plone Testing & Continuous Integration Team Report 2014
Plone Testing & Continuous Integration Team Report 2014
 
The Beauty and the Beast - Modern Javascript Development with AngularJS and P...
The Beauty and the Beast - Modern Javascript Development with AngularJS and P...The Beauty and the Beast - Modern Javascript Development with AngularJS and P...
The Beauty and the Beast - Modern Javascript Development with AngularJS and P...
 
The Butler and the Snake - JCICPH
The Butler and the Snake - JCICPHThe Butler and the Snake - JCICPH
The Butler and the Snake - JCICPH
 
The Butler and the Snake - Continuous Integration for Python
The Butler and the Snake - Continuous Integration for PythonThe Butler and the Snake - Continuous Integration for Python
The Butler and the Snake - Continuous Integration for Python
 
AngularJS & Plone
AngularJS & PloneAngularJS & Plone
AngularJS & Plone
 
Who let the robot out? Qualitativ hochwertige Software durch Continuous Integ...
Who let the robot out? Qualitativ hochwertige Software durch Continuous Integ...Who let the robot out? Qualitativ hochwertige Software durch Continuous Integ...
Who let the robot out? Qualitativ hochwertige Software durch Continuous Integ...
 
Plone5
Plone5Plone5
Plone5
 
Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...Who let the robot out? - Building high quality software with Continuous Integ...
Who let the robot out? - Building high quality software with Continuous Integ...
 
The Future Is Written - Building next generation Plone sites with plone.app.c...
The Future Is Written - Building next generation Plone sites with plone.app.c...The Future Is Written - Building next generation Plone sites with plone.app.c...
The Future Is Written - Building next generation Plone sites with plone.app.c...
 
Einführung Test-driven Development
Einführung Test-driven DevelopmentEinführung Test-driven Development
Einführung Test-driven Development
 
Test-Driven Development
Test-Driven DevelopmentTest-Driven Development
Test-Driven Development
 
Mock testing mit Python
Mock testing mit PythonMock testing mit Python
Mock testing mit Python
 

Último

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfSeasiaInfotech2
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 

Último (20)

Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
The Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdfThe Future of Software Development - Devin AI Innovative Approach.pdf
The Future of Software Development - Devin AI Innovative Approach.pdf
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 

Python-nose: A unittest-based testing framework for Python that makes writing and running tests easier

  • 1. Python-nose: A unittest-based testing framework for Python that makes writing and running tests easier Timo Stollenwerk April 27th, 2009 Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 2. Introduction Usually: Write unit tests with boilerplate code Automated test discovery and running process for unittest Intended to mimic the behavior of py.test Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 3. Installation $ e a s y _ i n s t a l l nose Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 4. Egg Installation setup.py ... setup ( ... t e s t _ s u i t e =' n o s e . c o l l e c t o r ' , t e s t _ r e q u i r e s =[ ' nose ' ] , i n s t a l l _ r e q u i r e s =[ ... ' nose ' , ], ... ) Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 5. Basic Usage nosetests [options] [(optional) test les or directories] Options Test selection (path, package, function, etc.) Run only tests with certain attributes PDB Plugins Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 6. Basic Usage: Conguration /.noserc [ nosetests ] v e r b o s i t y =3 with − d o c t e s t =1 d o c t e s t − e x t e n s i o n =. t x t Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 7. Writing Unit Tests Simplest possible failing test: def test ( ) : assert False And the simplest passing test: def test ( ) : pass Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 8. Example Unit Tests from l x m l i m p o r t o b j e c t i f y c l a s s TestTransform ( ) : d e f setUp ( s e l f ) : from html2docbook i m p o r t Html2DocBook h2d = Html2DocBook ( ) s e l f . h2d = h2d def test_paragraphs ( s e l f ) : html = 'plorem /ppipsum /p' e x p e c t = ' s e c t i o n paralorem /paraparai xml = s e l f . h2d . t r a n s f o r m ( html ) a s s e r t xml == e x p e c t Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 9. Automate your Unit tests with Nose nosy.py Every time you change any .py le, it runs tests Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 10. Automate your Unit tests with Nose and Eclipse Go to the project properties Dene a new programbuilder Set the location to the nosetest script Set the working directory to the project location ${workspace_loc:/html2docbook} Optional: append any command line options you want Go to the build optionstag and tick the launch in backgroundänd during auto builds. Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 11. Conclusion Nose makes it easier to write and run useful tests. Useful tests make it easier to write less code and better code. Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho
  • 12. Futher Information Nose: http://code.google.com/p/python-nose/ nosy.py: http://jeffwinkler.net/2006/04/27/ keeping-your-nose-green/ Automated python testing with nose and eclipse: http://www.machine-envy.com/blog/2006/07/29/ automated-python-testing-with-nose-and-eclipse/ Pycon 2008 Talk: Testing for the lazy coder http://us.pycon.org/common/2008/talkdata/ PyCon2008/079/nose_pycon08.pdf Timo Stollenwerk Python-nose: A unittest-based testing framework for Pytho