SlideShare une entreprise Scribd logo
1  sur  7
TDD with python, pytest and
vim
Setting up
Getting Started
• pip install pytest
• pip install pytest-xdist
• If you are using Anaconda, pytest should already be installed
Directory/Folder structure
Create a tests folder in your
project directory
Test data for testing
dataframes
Name corresponding test files
with a test_ infront
Using VIM
• Open vim <filename> in the root directory
• Enter :vsplit <tests/filename> in vim’s console
• You will get a split window.
• Ctrl-wx to swap columns in the order of preference. I.e. code on left,
test on right or vice versa
• Ctrl-ww to switch editing columns
Using VIM - vsplit
CODE TESTS
Using VIM – vsplit
Cursor
Here shows
where you are
editing
code testsCtrl-ww
Pytest
• Run pytest -f -v in
the root of your
project directory
• Pytest will be
watching for any
changes in the code
or tests.
• Once you save
either file, it will re-
run all tests
automatically

Contenu connexe

Tendances

인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
Amazon Web Services Korea
 

Tendances (20)

카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
카카오 광고 플랫폼 MSA 적용 사례 및 API Gateway와 인증 구현에 대한 소개
 
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2
FIWARE Global Summit - NGSI-LD – an Evolution from NGSIv2
 
Mastering the Sling Rewriter
Mastering the Sling RewriterMastering the Sling Rewriter
Mastering the Sling Rewriter
 
Running Kubernetes in hybrid environments with AWS (EKS Distro & EKS Anywhere...
Running Kubernetes in hybrid environments with AWS (EKS Distro & EKS Anywhere...Running Kubernetes in hybrid environments with AWS (EKS Distro & EKS Anywhere...
Running Kubernetes in hybrid environments with AWS (EKS Distro & EKS Anywhere...
 
Elasticsearch
ElasticsearchElasticsearch
Elasticsearch
 
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...
Amazon Personalize Event Tracker 실시간 고객 반응을 고려한 추천::김태수, 솔루션즈 아키텍트, AWS::AWS ...
 
Introduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang NguyenIntroduction of Kubernetes - Trang Nguyen
Introduction of Kubernetes - Trang Nguyen
 
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
인프라 자동 배포를 위한 AWS CloudFormation 고급 활용법 - AWS Summit Seoul 2017
 
infrastructure as code
infrastructure as codeinfrastructure as code
infrastructure as code
 
Agile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven DesignAgile, User Stories, Domain Driven Design
Agile, User Stories, Domain Driven Design
 
Confluent Operator as Cloud-Native Kafka Operator for Kubernetes
Confluent Operator as Cloud-Native Kafka Operator for KubernetesConfluent Operator as Cloud-Native Kafka Operator for Kubernetes
Confluent Operator as Cloud-Native Kafka Operator for Kubernetes
 
JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?JCR, Sling or AEM? Which API should I use and when?
JCR, Sling or AEM? Which API should I use and when?
 
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
[오픈소스컨설팅]쿠버네티스를 활용한 개발환경 구축
 
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
Amazon EKS로 간단한 웹 애플리케이션 구축하기 - 김주영 (AWS) :: AWS Community Day Online 2021
 
Single page application
Single page applicationSingle page application
Single page application
 
Build Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDBBuild Low-Latency Applications in Rust on ScyllaDB
Build Low-Latency Applications in Rust on ScyllaDB
 
높은 가용성과 성능 향상을 위한 ElastiCache 활용 팁 - 임근택, SendBird :: AWS Summit Seoul 2019
높은 가용성과 성능 향상을 위한 ElastiCache 활용 팁 - 임근택, SendBird :: AWS Summit Seoul 2019 높은 가용성과 성능 향상을 위한 ElastiCache 활용 팁 - 임근택, SendBird :: AWS Summit Seoul 2019
높은 가용성과 성능 향상을 위한 ElastiCache 활용 팁 - 임근택, SendBird :: AWS Summit Seoul 2019
 
Oracle eCommerce (ATG) Database Best Practices
Oracle eCommerce (ATG) Database  Best Practices Oracle eCommerce (ATG) Database  Best Practices
Oracle eCommerce (ATG) Database Best Practices
 
GitLab Auto DevOps with Container CI/CD
GitLab Auto DevOps with Container CI/CDGitLab Auto DevOps with Container CI/CD
GitLab Auto DevOps with Container CI/CD
 
(발표자료) CentOS EOL에 따른 대응 OS 검토 및 적용 방안.pdf
(발표자료) CentOS EOL에 따른 대응 OS 검토 및 적용 방안.pdf(발표자료) CentOS EOL에 따른 대응 OS 검토 및 적용 방안.pdf
(발표자료) CentOS EOL에 따른 대응 OS 검토 및 적용 방안.pdf
 

En vedette

Uno a uno somos mortales, juntos seremos eternos
Uno a uno somos mortales, juntos seremos eternosUno a uno somos mortales, juntos seremos eternos
Uno a uno somos mortales, juntos seremos eternos
Manuel Colmenero
 
Semestrario Esparza Herrera Ramón
Semestrario Esparza Herrera RamónSemestrario Esparza Herrera Ramón
Semestrario Esparza Herrera Ramón
Ramon Herrera
 
самостійна робота
самостійна роботасамостійна робота
самостійна робота
slavinskiy
 

En vedette (20)

Uno a uno somos mortales, juntos seremos eternos
Uno a uno somos mortales, juntos seremos eternosUno a uno somos mortales, juntos seremos eternos
Uno a uno somos mortales, juntos seremos eternos
 
TLC
TLCTLC
TLC
 
Semestrario Esparza Herrera Ramón
Semestrario Esparza Herrera RamónSemestrario Esparza Herrera Ramón
Semestrario Esparza Herrera Ramón
 
Aplicaciones de Herramientas
Aplicaciones de HerramientasAplicaciones de Herramientas
Aplicaciones de Herramientas
 
Becoming an Influencer: Strategies for Change
Becoming an Influencer: Strategies for ChangeBecoming an Influencer: Strategies for Change
Becoming an Influencer: Strategies for Change
 
Ondas y sonido
Ondas y sonidoOndas y sonido
Ondas y sonido
 
Practical Guide to Product Roadmapping
Practical Guide to Product RoadmappingPractical Guide to Product Roadmapping
Practical Guide to Product Roadmapping
 
Scooters for sale
Scooters for saleScooters for sale
Scooters for sale
 
Value-Based Payments and Managed Care Contracting - Crash Course Webinar Series
Value-Based Payments and Managed Care Contracting - Crash Course Webinar SeriesValue-Based Payments and Managed Care Contracting - Crash Course Webinar Series
Value-Based Payments and Managed Care Contracting - Crash Course Webinar Series
 
CUMPLEAÑOS 84 DE LA CIUDAD DE EL TIGRE pdf
CUMPLEAÑOS 84 DE LA CIUDAD DE EL TIGRE pdfCUMPLEAÑOS 84 DE LA CIUDAD DE EL TIGRE pdf
CUMPLEAÑOS 84 DE LA CIUDAD DE EL TIGRE pdf
 
Flink meetup
Flink   meetupFlink   meetup
Flink meetup
 
Piwik PRO The Real Cost of Data Privacy
Piwik PRO The Real Cost of Data Privacy Piwik PRO The Real Cost of Data Privacy
Piwik PRO The Real Cost of Data Privacy
 
самостійна робота
самостійна роботасамостійна робота
самостійна робота
 
Peter Hinssen @ Revolve! UnConference
Peter Hinssen @ Revolve! UnConferencePeter Hinssen @ Revolve! UnConference
Peter Hinssen @ Revolve! UnConference
 
Digipak case study
Digipak case studyDigipak case study
Digipak case study
 
McGregor Boyall Asia Pacific Brochure
McGregor Boyall Asia Pacific BrochureMcGregor Boyall Asia Pacific Brochure
McGregor Boyall Asia Pacific Brochure
 
Les big data KU Leuven
Les big data KU LeuvenLes big data KU Leuven
Les big data KU Leuven
 
Chan thuong nguc
Chan thuong ngucChan thuong nguc
Chan thuong nguc
 
03 conversores cc ca (inversores)
03 conversores cc ca (inversores)03 conversores cc ca (inversores)
03 conversores cc ca (inversores)
 
Några myter om dubbade och odubbade vinterdäck
Några myter om dubbade och odubbade vinterdäckNågra myter om dubbade och odubbade vinterdäck
Några myter om dubbade och odubbade vinterdäck
 

Similaire à Testing with Python, Pytest and Vim

Pysys testframework
Pysys testframeworkPysys testframework
Pysys testframework
Moray Grieve
 
Dspace4 150227090306-conversion-gate01
Dspace4 150227090306-conversion-gate01Dspace4 150227090306-conversion-gate01
Dspace4 150227090306-conversion-gate01
walaba06
 
DSpace 4.2 Basics & Configuration
DSpace 4.2 Basics & ConfigurationDSpace 4.2 Basics & Configuration
DSpace 4.2 Basics & Configuration
DuraSpace
 
Subversion
SubversionSubversion
Subversion
rchakra
 
Agile db testing_techniques
Agile db testing_techniquesAgile db testing_techniques
Agile db testing_techniques
Tarik Essawi
 

Similaire à Testing with Python, Pytest and Vim (20)

Pysys testframework
Pysys testframeworkPysys testframework
Pysys testframework
 
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
(ATS3-DEV02) Scripting with .NET Assemblies in Symyx Notebook
 
(ATS6-APP09) ELN configuration management with ADM
(ATS6-APP09) ELN configuration management with ADM(ATS6-APP09) ELN configuration management with ADM
(ATS6-APP09) ELN configuration management with ADM
 
Dspace4 150227090306-conversion-gate01
Dspace4 150227090306-conversion-gate01Dspace4 150227090306-conversion-gate01
Dspace4 150227090306-conversion-gate01
 
DSpace 4.2 Basics & Configuration
DSpace 4.2 Basics & ConfigurationDSpace 4.2 Basics & Configuration
DSpace 4.2 Basics & Configuration
 
Linux Container Primitives and Runtimes (CON407-R1) - AWS re:Invent 2018
Linux Container Primitives and Runtimes (CON407-R1) - AWS re:Invent 2018Linux Container Primitives and Runtimes (CON407-R1) - AWS re:Invent 2018
Linux Container Primitives and Runtimes (CON407-R1) - AWS re:Invent 2018
 
Week 5 open session
Week 5 open sessionWeek 5 open session
Week 5 open session
 
Subversion
SubversionSubversion
Subversion
 
Automated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and JenkinsAutomated Testing Environment by Bugzilla, Testopia and Jenkins
Automated Testing Environment by Bugzilla, Testopia and Jenkins
 
CNIT 152 13 Investigating Mac OS X Systems
CNIT 152 13 Investigating Mac OS X SystemsCNIT 152 13 Investigating Mac OS X Systems
CNIT 152 13 Investigating Mac OS X Systems
 
System Programming and Administration
System Programming and AdministrationSystem Programming and Administration
System Programming and Administration
 
Bug zillatestopiajenkins
Bug zillatestopiajenkinsBug zillatestopiajenkins
Bug zillatestopiajenkins
 
Nuclei.pptx
Nuclei.pptxNuclei.pptx
Nuclei.pptx
 
Agile db testing_techniques
Agile db testing_techniquesAgile db testing_techniques
Agile db testing_techniques
 
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
Automated Testing with Docker on Steroids - nlOUG TechExperience 2018 (Amersf...
 
SFDC Deployments
SFDC DeploymentsSFDC Deployments
SFDC Deployments
 
Adding unit tests to the database deployment pipeline
Adding unit tests to the database deployment pipelineAdding unit tests to the database deployment pipeline
Adding unit tests to the database deployment pipeline
 
Ts windchill data_loading
Ts windchill data_loadingTs windchill data_loading
Ts windchill data_loading
 
XPages -Beyond the Basics
XPages -Beyond the BasicsXPages -Beyond the Basics
XPages -Beyond the Basics
 
Big data key-value and column stores redis - cassandra
Big data  key-value and column stores redis - cassandraBig data  key-value and column stores redis - cassandra
Big data key-value and column stores redis - cassandra
 

Dernier

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Dernier (20)

ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

Testing with Python, Pytest and Vim

  • 1. TDD with python, pytest and vim Setting up
  • 2. Getting Started • pip install pytest • pip install pytest-xdist • If you are using Anaconda, pytest should already be installed
  • 3. Directory/Folder structure Create a tests folder in your project directory Test data for testing dataframes Name corresponding test files with a test_ infront
  • 4. Using VIM • Open vim <filename> in the root directory • Enter :vsplit <tests/filename> in vim’s console • You will get a split window. • Ctrl-wx to swap columns in the order of preference. I.e. code on left, test on right or vice versa • Ctrl-ww to switch editing columns
  • 5. Using VIM - vsplit CODE TESTS
  • 6. Using VIM – vsplit Cursor Here shows where you are editing code testsCtrl-ww
  • 7. Pytest • Run pytest -f -v in the root of your project directory • Pytest will be watching for any changes in the code or tests. • Once you save either file, it will re- run all tests automatically