[Python] unsubscribe

Simone Federici s.federici a gmail.com
Sab 8 Ago 2015 19:44:44 CEST


beep

On Saturday, August 8, 2015, Mauro Troiaio <mauro.trs a gmail.com> wrote:

>
>
> Inviato da iPhone
>
> > Il giorno 08/ago/2015, alle ore 12:00, python-request a lists.python.it
> <javascript:;> ha scritto:
> >
> > Invia le richieste di iscrizione alla lista Python all'indirizzo
> >    python a lists.python.it <javascript:;>
> >
> > Per iscriverti o cancellarti attraverso il web, visita
> >    http://lists.python.it/mailman/listinfo/python
> > oppure, via email, manda un messaggio con oggetto `help' all'indirizzo
> >    python-request a lists.python.it <javascript:;>
> >
> > Puoi contattare la persona che gestisce la lista all'indirizzo
> >    python-owner a lists.python.it <javascript:;>
> >
> > Se rispondi a questo messaggio, per favore edita la linea dell'oggetto
> > in modo che sia più utile di un semplice "Re: Contenuti del digest
> > della lista Python..."
> >
> >
> > Argomenti del Giorno:
> >
> >   1. Mockare aiohttp per tests (flandero)
> >   2. Re: Mockare aiohttp per tests (Manlio Perillo)
> >   3. Re: Mockare aiohttp per tests (flandero)
> >   4. Re: Mockare aiohttp per tests (Manlio Perillo)
> >   5. Re: Mockare aiohttp per tests (enrico franchi)
> >
> >
> > ----------------------------------------------------------------------
> >
> > Message: 1
> > Date: Fri, 7 Aug 2015 16:50:32 +0200
> > From: flandero <flandero a gmail.com <javascript:;>>
> > To: Discussioni generali sul linguaggio Python
> >    <python a lists.python.it <javascript:;>>
> > Subject: [Python] Mockare aiohttp per tests
> > Message-ID:
> >    <CANkwUuYfEdy6a6vg4C-nBokz1V7jD=Lq-kZ7wkmPfVtuptK2Vw a mail.gmail.com
> <javascript:;>>
> > Content-Type: text/plain; charset="utf-8"
> >
> > Ciao,
> > sto usando una library per mockare su requests, chiamata httpretty. Un
> > codice tipo questo:
> >
> > import httpretty
> > import requests
> > @httpretty.httprettified
> > def prova():
> >  httpretty.register_uri(method=httpretty.POST,uri='http://url/
> ',body='ciao
> > ciao')
> >  requests.post('http://url/', data={'a': 1})
> >  print(httpretty.last_request().body)
> >
> > Molto bello, e rende testabili componenti che altrimenti non lo
> sarebbero.
> >
> > La faccenda si complica quando inizio a testare codice asincrono, in cui
> ho
> > usato aiohttp e non requests, perché non ho niente di simile per aiohttp.
> > Dopo qualche ora di infruttuosa ricerca ho deciso di scrivere questa
> mail:
> > mi serve qualcosa che mi permetta di mockare aiohttp come fa httpretty
> con
> > requests.
> >
> > Ogni suggerimento, quindi, è ben accetto. Grazie! :-)
> > -------------- parte successiva --------------
> > Un allegato HTML è stato rimosso...
> > URL: <
> http://lists.python.it/pipermail/python/attachments/20150807/1c4faaa8/attachment-0001.html
> >
> >
> > ------------------------------
> >
> > Message: 2
> > Date: Fri, 7 Aug 2015 17:42:32 +0200
> > From: Manlio Perillo <manlio.perillo a gmail.com <javascript:;>>
> > To: Discussioni generali sul linguaggio Python
> >    <python a lists.python.it <javascript:;>>
> > Subject: Re: [Python] Mockare aiohttp per tests
> > Message-ID:
> >    <CAAToxAEqm_hRh3VBA-p6hmrCxoQiiCaBKsn9vPV4LZNuwR5w9Q a mail.gmail.com
> <javascript:;>>
> > Content-Type: text/plain; charset="utf-8"
> >
> > 2015-08-07 16:50 GMT+02:00 flandero <flandero a gmail.com <javascript:;>>:
> >
> >> Ciao,
> >> sto usando una library per mockare su requests, chiamata httpretty. Un
> >> codice tipo questo:
> >>
> >> import httpretty
> >> import requests
> >> @httpretty.httprettified
> >> def prova():
> >>  httpretty.register_uri(method=httpretty.POST,uri='http://url/
> ',body='ciao
> >> ciao')
> >>  requests.post('http://url/', data={'a': 1})
> >>  print(httpretty.last_request().body)
> >>
> >> Molto bello, e rende testabili componenti che altrimenti non lo
> sarebbero.
> > Io quando devo testare un client HTTP lancio un server WSGI in un
> processo
> > separato (multiprocessing),
> > utilizzando una Queue per la comunicazione.
> >
> >> [...]
> >
> > Ciao  Manlio
> > -------------- parte successiva --------------
> > Un allegato HTML è stato rimosso...
> > URL: <
> http://lists.python.it/pipermail/python/attachments/20150807/c97e3060/attachment-0001.html
> >
> >
> > ------------------------------
> >
> > Message: 3
> > Date: Fri, 7 Aug 2015 18:41:58 +0200
> > From: flandero <flandero a gmail.com <javascript:;>>
> > To: Discussioni generali sul linguaggio Python
> >    <python a lists.python.it <javascript:;>>
> > Subject: Re: [Python] Mockare aiohttp per tests
> > Message-ID:
> >    <CANkwUuaCLS_A9VnfC-aExdV2+R6R9rZ0XbATj6nC2HFzPzjW-Q a mail.gmail.com
> <javascript:;>>
> > Content-Type: text/plain; charset="utf-8"
> >
> > La cosa bella e' che lavorando con asyncio non avrei neanche bisogno di
> > multiprocessing e queues, ma cosi' non si sconfina dal contesto test di
> > unita' a quello dei test di interoperabilita'?
> >> On Aug 7, 2015 5:42 PM, "Manlio Perillo" <manlio.perillo a gmail.com
> <javascript:;>> wrote:
> >>
> >> 2015-08-07 16:50 GMT+02:00 flandero <flandero a gmail.com <javascript:;>
> >:
> >>
> >>> Ciao,
> >>> sto usando una library per mockare su requests, chiamata httpretty. Un
> >>> codice tipo questo:
> >>>
> >>> import httpretty
> >>> import requests
> >>> @httpretty.httprettified
> >>> def prova():
> >>>  httpretty.register_uri(method=httpretty.POST,uri='http://url/
> ',body='ciao
> >>> ciao')
> >>>  requests.post('http://url/', data={'a': 1})
> >>>  print(httpretty.last_request().body)
> >>>
> >>> Molto bello, e rende testabili componenti che altrimenti non lo
> sarebbero.
> >> Io quando devo testare un client HTTP lancio un server WSGI in un
> processo
> >> separato (multiprocessing),
> >> utilizzando una Queue per la comunicazione.
> >>
> >>> [...]
> >>
> >> Ciao  Manlio
> >>
> >> _______________________________________________
> >> Python mailing list
> >> Python a lists.python.it <javascript:;>
> >> http://lists.python.it/mailman/listinfo/python
> > -------------- parte successiva --------------
> > Un allegato HTML è stato rimosso...
> > URL: <
> http://lists.python.it/pipermail/python/attachments/20150807/52cf438f/attachment-0001.html
> >
> >
> > ------------------------------
> >
> > Message: 4
> > Date: Fri, 7 Aug 2015 19:21:00 +0200
> > From: Manlio Perillo <manlio.perillo a gmail.com <javascript:;>>
> > To: Discussioni generali sul linguaggio Python
> >    <python a lists.python.it <javascript:;>>
> > Subject: Re: [Python] Mockare aiohttp per tests
> > Message-ID:
> >    <CAAToxAGSnwhZ_KjuPGUtEZT1SG7Swd4ADyRMciZLSPQEn+LY=A a mail.gmail.com
> <javascript:;>>
> > Content-Type: text/plain; charset="utf-8"
> >
> > 2015-08-07 18:41 GMT+02:00 flandero <flandero a gmail.com <javascript:;>>:
> >
> >> La cosa bella e' che lavorando con asyncio non avrei neanche bisogno di
> >> multiprocessing e queues,
> >
> > Puoi anche lanciare il server HTTP all'interno dello stesso processo
> usando
> > un thread o asyncio ma hai comunque bisogno di un canale di
> comunicazione.
> > Come implementi tale canale è solo un dettaglio; una queue è la soluzione
> > forse più semplice.
> >
> >> ma cosi' non si sconfina dal contesto test di unita' a quello dei test
> di
> >> interoperabilita'?
> >
> > Se hai un client HTTP e devi testare che la richiesta che fa è corretta,
> > non vedo modo migliore di usare un server HTTP
> > e verificare quello che viene ricevuto.
> >
> > Fare il mocking la vedo come ultima risorsa.
> >
> >
> > Ciao  Manlio
> > -------------- parte successiva --------------
> > Un allegato HTML è stato rimosso...
> > URL: <
> http://lists.python.it/pipermail/python/attachments/20150807/e37ee24d/attachment-0001.html
> >
> >
> > ------------------------------
> >
> > Message: 5
> > Date: Fri, 7 Aug 2015 23:52:12 +0100
> > From: enrico franchi <enrico.franchi a gmail.com <javascript:;>>
> > To: Discussioni generali sul linguaggio Python
> >    <python a lists.python.it <javascript:;>>
> > Subject: Re: [Python] Mockare aiohttp per tests
> > Message-ID:
> >    <CA+T0K1Z3wMruAk7pcM9OLmqaP7FZLEGUGh8TM35AJn8msA2rfA a mail.gmail.com
> <javascript:;>>
> > Content-Type: text/plain; charset="utf-8"
> >
> > 2015-08-07 18:21 GMT+01:00 Manlio Perillo <manlio.perillo a gmail.com
> <javascript:;>>:
> >
> >> Se hai un client HTTP e devi testare che la richiesta che fa è corretta,
> >> non vedo modo migliore di usare un server HTTP
> >> e verificare quello che viene ricevuto.
> >>
> >> Fare il mocking la vedo come ultima risorsa.
> >
> >
> > Sono due cose diverse.
> >
> > --
> > .
> > ..: -enrico-
> > -------------- parte successiva --------------
> > Un allegato HTML è stato rimosso...
> > URL: <
> http://lists.python.it/pipermail/python/attachments/20150807/f03a4c7f/attachment-0001.html
> >
> >
> > ------------------------------
> >
> > _______________________________________________
> > Python mailing list
> > Python a lists.python.it <javascript:;>
> > http://lists.python.it/mailman/listinfo/python
> >
> >
> > Fine di Digest di Python, Volume 114, Numero 3
> > **********************************************
> _______________________________________________
> Python mailing list
> Python a lists.python.it <javascript:;>
> http://lists.python.it/mailman/listinfo/python
>


-- 
Simone Federici
------------------------
Software Craftsman
XP, Agile, Scrum, Kanban
Quality, performance & security

Explicit is better than implicit.
-------------- parte successiva --------------
Un allegato HTML è stato rimosso...
URL: <http://lists.python.it/pipermail/python/attachments/20150808/3ae69ab1/attachment-0001.html>


Maggiori informazioni sulla lista Python