Skip to content

Conversation

lorenzodidomenic
Copy link

No description provided.

@Picred
Copy link
Collaborator

Picred commented Nov 8, 2023

Dalla pipeline ho letto che il coverage di ex5.py è 0% che implica che si devono fare più test per tale esercizio. Non ne sono sicuro ma secondo me è perchè in ex5.py non testi la funzione (visto che non esiste) ma "il file". Sarebbe comunque meglio mettere, in ex5.py la funzione def ex5() e importarla dal file di test.

@lorenzodidomenic
Copy link
Author

how can I see coverage of my test?


k = random()
print("the random number is")
print(k)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Definisci una funzione



def testex5(mocker : MockerFixture)->None:
mocker.patch.object(ex5,"random",return_value = 10)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Domanda: era necessario mockare random ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants