0
Python tools   for testing       English LT #2Kazuhiro Oinuma (@oinume)
About myself
About myself• CyberAgent,Inc since 2010.3
About myself• CyberAgent,Inc since 2010.3• Like Perl, Python, Ruby
About myself• CyberAgent,Inc since 2010.3• Like Perl, Python, Ruby• Twitter: @oinume
About myself• CyberAgent,Inc since 2010.3• Like Perl, Python, Ruby• Twitter: @oinume• My blog: Oinuma Nippou
Recently I learned
Recently I learned• py.test
Recently I learned• py.test• tox
Recently I learned• py.test• tox• ToravisCI
py.test
py.test• An unit test library
py.test• An unit test library• Better than nose
py.test• An unit test library• Better than nose • Test results are readable
py.test• An unit test library• Better than nose • Test results are readable • Has mocking feature
py.test• An unit test library• Better than nose • Test results are readable • Has mocking feature • Can generate junit xml...
nose test results
py.test test results
Mocking featuremonkeypatch.setattr()overwrites an attribute (method)
--junitxml
--junitxml• --junitxml=junit.xml generates XML for Jenkins
--junitxml• --junitxml=junit.xml generates XML for Jenkins• This is a core feature
--junitxml• --junitxml=junit.xml generates XML for Jenkins• This is a core feature • nose s one is optional.
tox
tox• Run unit tests with multiple  pythons (2.5, 2.6, 2.7, etc...)
tox• Run unit tests with multiple  pythons (2.5, 2.6, 2.7, etc...)• Using virtualenv
tox• Run unit tests with multiple  pythons (2.5, 2.6, 2.7, etc...)• Using virtualenv • Python environment manager
tox• Run unit tests with multiple  pythons (2.5, 2.6, 2.7, etc...)• Using virtualenv • Python environment manager• Demo
TravisCI
TravisCI
TravisCI• CI tools for open-sourced Github  projects
TravisCI• CI tools for open-sourced Github  projects• Ready for Perl, Python, Ruby, Java,  JavaScript (w/ Node.js), Scala
TravisCI• CI tools for open-sourced Github  projects• Ready for Perl, Python, Ruby, Java,  JavaScript (w/ Node.js), Scala•...
How to get to use
How to get to use• Enabling TravisCI hook for Github
How to get to use• Enabling TravisCI hook for Github• Put .travis.yml in the project  directory
How to get to use• Enabling TravisCI hook for Github• Put .travis.yml in the project  directory• Then, just commit and pus...
Enabling a hook
.travis.ymllanguage: pythonpython:  - "2.5"  - "2.6"  - "2.7"install:  - pip install . --use-mirrors  - pip install mock>=...
After build
Testing becomes   more fun !
Thank You
Upcoming SlideShare
Loading in...5
×

20120524 english lt2_pythontoolsfortesting

389

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
389
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Transcript of "20120524 english lt2_pythontoolsfortesting"

    1. 1. Python tools for testing English LT #2Kazuhiro Oinuma (@oinume)
    2. 2. About myself
    3. 3. About myself• CyberAgent,Inc since 2010.3
    4. 4. About myself• CyberAgent,Inc since 2010.3• Like Perl, Python, Ruby
    5. 5. About myself• CyberAgent,Inc since 2010.3• Like Perl, Python, Ruby• Twitter: @oinume
    6. 6. About myself• CyberAgent,Inc since 2010.3• Like Perl, Python, Ruby• Twitter: @oinume• My blog: Oinuma Nippou
    7. 7. Recently I learned
    8. 8. Recently I learned• py.test
    9. 9. Recently I learned• py.test• tox
    10. 10. Recently I learned• py.test• tox• ToravisCI
    11. 11. py.test
    12. 12. py.test• An unit test library
    13. 13. py.test• An unit test library• Better than nose
    14. 14. py.test• An unit test library• Better than nose • Test results are readable
    15. 15. py.test• An unit test library• Better than nose • Test results are readable • Has mocking feature
    16. 16. py.test• An unit test library• Better than nose • Test results are readable • Has mocking feature • Can generate junit xml format
    17. 17. nose test results
    18. 18. py.test test results
    19. 19. Mocking featuremonkeypatch.setattr()overwrites an attribute (method)
    20. 20. --junitxml
    21. 21. --junitxml• --junitxml=junit.xml generates XML for Jenkins
    22. 22. --junitxml• --junitxml=junit.xml generates XML for Jenkins• This is a core feature
    23. 23. --junitxml• --junitxml=junit.xml generates XML for Jenkins• This is a core feature • nose s one is optional.
    24. 24. tox
    25. 25. tox• Run unit tests with multiple pythons (2.5, 2.6, 2.7, etc...)
    26. 26. tox• Run unit tests with multiple pythons (2.5, 2.6, 2.7, etc...)• Using virtualenv
    27. 27. tox• Run unit tests with multiple pythons (2.5, 2.6, 2.7, etc...)• Using virtualenv • Python environment manager
    28. 28. tox• Run unit tests with multiple pythons (2.5, 2.6, 2.7, etc...)• Using virtualenv • Python environment manager• Demo
    29. 29. TravisCI
    30. 30. TravisCI
    31. 31. TravisCI• CI tools for open-sourced Github projects
    32. 32. TravisCI• CI tools for open-sourced Github projects• Ready for Perl, Python, Ruby, Java, JavaScript (w/ Node.js), Scala
    33. 33. TravisCI• CI tools for open-sourced Github projects• Ready for Perl, Python, Ruby, Java, JavaScript (w/ Node.js), Scala• You don t need to setup Jenkins any more!!
    34. 34. How to get to use
    35. 35. How to get to use• Enabling TravisCI hook for Github
    36. 36. How to get to use• Enabling TravisCI hook for Github• Put .travis.yml in the project directory
    37. 37. How to get to use• Enabling TravisCI hook for Github• Put .travis.yml in the project directory• Then, just commit and push !
    38. 38. Enabling a hook
    39. 39. .travis.ymllanguage: pythonpython: - "2.5" - "2.6" - "2.7"install: - pip install . --use-mirrors - pip install mock>=0.8 pytest>=2.2 pytest-cov>=1.5script: - py.test tests/internal
    40. 40. After build
    41. 41. Testing becomes more fun !
    42. 42. Thank You
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×