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.

We would like to implement unit testing for modules that is activated when run with something like the --runtests argument.

Implementing this would make it much easier to see when a change breaks something important.

We plan on integrating with Codacy’s coverage system. https://support.codacy.com/hc/en-us/articles/207312879-Generate-Coverage

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
laxdogcommented, Mar 5, 2017

The more I look at this, the more I think there needs to be a major rewrite. It’s been written in a way that tries to re-implement classes with liberal use of globals. It would be much better if they were all proper python classes with init()

Also, we shouldn’t really be starting threads and processing during the init function. It means in testing for example, I can’t just initialise a class to call some methods without having it actually running and doing things I don’t want it to behind the scenes. It becomes especially problematic when I want to have multiples as they start messing with each others files.

Unfortunately it’s a bit of a chicken egg scenario as really we’d want tests to rewrite the modules, but I want to rewrite the modules to write the tests.

Given the position though, I think it’s best to get the tests done to start, then begin moving the modules and tests to a new structure. This means though I’m going have to add a new parameter to a lot of the functions so I can pass the variables we’re interested in to it (to avoid creating a new ‘instance’).

I’ll raise a PR for what I’ve got so far, but I need to redo a lot of it. The frameworks I’m using are nose and hypothesis, but I’ve found out recently that nose is pretty much dead and people have moved to py.test mostly.

1reaction
laxdogcommented, Feb 21, 2017

Haven’t forgotten about this, just haven’t had time yet. I’m on vacation soon too, so it’s going to be a few weeks.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Unit Testing Tutorial – What is, Types & Test Example - Guru99
Unit Testing is a type of software testing where individual units or components of a software are tested. The purpose is to validate...
Read more >
Unit testing - Wikipedia
In computer programming, unit testing is a software testing method by which individual units of source code—sets of one or more computer program...
Read more >
What Is Unit Testing? - SmartBear
Unit Testing is the process of checking small pieces of code to deliver information early and often, speeding your testing strategies, and reducing...
Read more >
Unit Testing | Software Testing - GeeksforGeeks
Unit Testing is defined as a type of software testing where individual components of a software are tested. Unit Testing of the software...
Read more >
Unit testing fundamentals - Visual Studio (Windows)
Check that your code is working as expected by creating and running unit tests. It's called unit testing because you break down the ......
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