question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add unit-tests for databaseconnect.py

See original GitHub issue

Requirement

Unit tests are required for the script databaseconnect.py

Pre-requisite

Intermediate knowledge of Python

Dependencies

None

Description

Unit tests provide confidence whether the individual components are working as intended or not; and help in catching bugs that we may not be able to manually find out. We’ll need to add tests for each function/module using a testing library like pytest

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
vishakha-lallcommented, Mar 22, 2020

Track your progress here @msk4862. Use this PR for reference.

0reactions
msk4862commented, Mar 25, 2020

okay

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to unit test the module which contains database ...
I have a function in module, where I connect to the database using pymysql and do only database insert operations.How to unit test...
Read more >
Python Testing using Unittest with a Mock SQL Database
For this tutorial, I'll be using the second method. Creating the SetUpClass method. First, we define our database connection. Then we check if ......
Read more >
Unit testing for Python database applications - Gems
How I can unit test such a function? Solution. Use unittest.mock to generate mock database connection. It is as simple as:.
Read more >
3 Ways to Implement the Mock During Python Unit Testing
Either question, it's clear that unit testing is salient to being confident that your program will execute successfully.
Read more >
Create a Mock Database for Unit Testing in Python | Dev Genius
Let's assume you wrote some Python code to manipulate data which is stored in an SQL table. You are a seasoned programmer, so...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found