hanyazou/TelloPy

I can't test properly with unittest.

Opened this issue · 0 comments

I have a project that involves this Tello Python library.

Everything else works fine, except the test won't stop, despite it being completed regardless of success or failure.

I have to manually disable the test which is very tedious, and it will not work when firing multiple tests at once, because when once Tello object is created, it will not be destroyed and can't be called again twice.

This is error i get:

Stdout:
[WinError 10048] Normalt må en socket-adresse (protokol/netværksadresse/port) kun bruges én gang
Testing are done.

Stderr:
Traceback (most recent call last):
  File "c:\Users\zaina\OneDrive\Skoleopgaver\Robotteknologi\Bachelorprojekt\Source code\pytello\Arucodetector.py", line 57, in ConnectDrone
    self.SetDrone(tellopy.Tello())
  File "C:\Users\zaina\anaconda3\lib\site-packages\tellopy\_internal\tello.py", line 91, in __init__
    self.sock.bind(('', self.port))
OSError: [WinError 10048] Normalt må en socket-adresse (protokol/netværksadresse/port) kun bruges én gang

You can clearly see what i mean on that screenshot:
billede

Look at the blue lines I've made. These points out a nonterminating process that prevents re-instantiation of Tello Object.