Skip to main content

All Questions

Tagged with
0 votes
1 answer
205 views

Best practices for setting up a test suite for a python library?

note: here library means a package that is installed from some wheel/egg/tar file. as opposed to a regular package which is just a container of modules basically. package usually is used for both as ...
gnarlyninja's user avatar
-1 votes
2 answers
273 views

Should this code be made testable? [closed]

My code looks roughly like 40 def send_pubkey( s: socket ) -> None: 41 '''Transmit own public key unencrypted.''' 42 ...
Vorac's user avatar
  • 7,159
-1 votes
1 answer
172 views

Efficient way to write test cases depending on a Micro service

I'm very new to microservice architecture. In the Monolithic app structure, it was pretty straightforward to write test cases since everything was in one app. I have a situation where I manage a ...
Koushik Das's user avatar
3 votes
0 answers
78 views

Confused about how to test Python scripts that install and configure a development setup on OSX (VMware? Docker-OSX?)

In my company we hire engineers for various "disciplines"—iOS, Android, Web, Backend, Data, etc. Engineers follow an onboarding workbook to install what they need for their discipline. iOS ...
Andrew Cheong's user avatar
-1 votes
1 answer
572 views

How to write tests for a class that talks to a server without revealing connection implementation

I'm writing a class that acts as the interface to a server. The interface exposes a way to send messages to the server and pass messages back to the client through a callback. Implementations should ...
cluelessatthis's user avatar
2 votes
3 answers
1k views

Still don't understand when to mock and when not to

I've been trying to understand when to mock and when not to mock, however I'm not able to come up with a consistent guideline and I'm hoping to get some input on the subject. Let's look at the ...
de1337ed's user avatar
  • 175
1 vote
3 answers
1k views

Should I unit test functions internally used by API I expose?

I'm writing a CRUD app in Python that exposes web API. At first I wrote functions for communicating with DB and wrote tests for these functions. def crud(): # do something with db def test_crud(): ...
CommanderPrice's user avatar
0 votes
0 answers
93 views

Trade-off between usability and clean design

I have designed our in-house hardware testing framework. My goal is to ultimately release the framework into the public domain. Early on, my foremost design criterion was to provide a powerful yet ...
user3638629's user avatar
2 votes
1 answer
2k views

Should I check floating point values in a unit test?

We have unit tests that are running some underlying model. We provide it with some test input, and receive some outputs + floating point scores. What's a good practice from a unit-testing standpoint? ...
de1337ed's user avatar
  • 175
1 vote
2 answers
265 views

Automating performance tests for python code in a CI

My apologies in advance for a question that might seem trivial - I am a mostly solo dev in academic environment and a lot of industry best practices don't necessarily make it here. Several of my ...
Andrei Kucharavy's user avatar
-1 votes
2 answers
1k views

How do you unit test methods with hard/impossible inputs to hardcode?

I have the following problem. I have a method which takes two other custom objects to work. This objects are required by the method because they have the information that the method requires to ...
Jorge Verdeguer Gómez's user avatar
6 votes
3 answers
5k views

Is there a better way to run sequential tests?

I'm using unittest framework to run Python tests. Some system tests consist of a series of steps for a given scenario, and they need to run in a specific order. For example, I have a client ...
Arseni Mourzenko's user avatar
2 votes
3 answers
203 views

How can I avoid chasing my own tail when testing against complicated return values?

Sometimes there are functions that return complicated data and cannot be divided any further e.g. in the area of signal processing or when reading and decoding a bytestring to another format. How am I ...
Agent49's user avatar
  • 23
4 votes
2 answers
3k views

What's the best way to get GitLab Docker runners and Python tox to work together?

I'm trying to get a better understanding of how tox and GitLab CI (with docker runners) would work together, as they seem to have a bit of overlap in what each does. I think I may be missing something ...
Garrett Motzner's user avatar
-4 votes
1 answer
1k views

Is it possible to derive a test suite to achieve 100% path coverage? [closed]

Here is an example with the function: Examining this I believe that it is possible to achieve 100% path coverage. My understanding of path coverage is that you need to design test cases such that ...
Sri's user avatar
  • 13

15 30 50 per page