GithubHelp home page GithubHelp logo

epcervantes7 / pytestfordatascience_pydatala Goto Github PK

View Code? Open in Web Editor NEW

This project forked from canyon289/pytestfordatascience_pydatala

0.0 1.0 0.0 466 KB

Pytest for Data Science Beginners

Python 100.00%

pytestfordatascience_pydatala's Introduction

Pytest for Data Science

Pytest for Data Science Beginners. No prior testing knowledge is assumed!
This is a tutorial given at PyData Los Angeles 2018

Goal

Introduce testing philosophy and code. By end of tutorial attendees will be able to write pytest unit tests themselves. Specifically they will know about

  • Pytest test patterns
  • Pytest Fixures
  • Mock
  • Monkeypatch
  • References to advanced topics such as parameterized tests and test runner configuration

Agenda

Introduction

About the speaker and format of talk

Is testing needed in Data Science?

Spoiler alert, yes. Testing is widely used in serious data science. We'll cover examples and real world cases.

Instructor Examples and Attendee activities

This tutorial will have plenty of hands on activities. Each section below will have an instructor explanation followed with a student challenge.

How pytest works and writing a basic test

We'll cover how to structure tests for use with pytest, and also an example of why pytest is the preferred testing framework for many projects

Test Fixtures

Fixtures are an important component of testing that allows for reuse of mutable data structures. If this doesn't make sense now it will after going through this example.

Mock

Loading data or running a model sometimes takes minutes or even hours. We'll see how mock can be used to "fake" python data structures to make writing and running tests faster and more isolated.

Monkey Patch

In data science you'll frequently be using other peoples libraries. This example will show how to alter functionality during testing time and why this is sometimes desired.

Next steps and advanced topics

We'll have an open discussion about functionality such as parametrization, test finalizers, exception testing, and code coverage

SpeakerRate

Feedback on this talk is welcome! https://speakerrate.com/events/18193-pydata-los-angeles-2018

pytestfordatascience_pydatala's People

Contributors

canyon289 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.