2015-08-05 17:22 GMT+02:00 Manlio Perillo :
> Oggi per la prima volta sto lavorando ad un progetto che contiene più di
> un package:
>
> pkg/
> foo/
> bar/
> test/
> foo/
> bar/
>
> La directory `test` contiene la test suite.
>
> Il problema è che quando eseguo i test c
2015-08-05 17:57 GMT+02:00 Federico Dolce :
> Potresti usare un'import relativo:
>
> from .. import foo (se sei su python2 dovrai importare anche
> absolute_import da future )
>
> https://www.python.org/dev/peps/pep-0328/#guido-s-decision
>
>
Grazie, ma non ci ho nemmeno provato ad usare gli impor
2015-08-05 19:00 GMT+02:00 Marco Giusti :
> On Wed, Aug 05 2015, Manlio Perillo wrote:
> > Oggi per la prima volta sto lavorando ad un progetto che contiene più di
> un
> > package:
> >
> > pkg/
> > foo/
> > bar/
> > test/
> > foo/
> > bar/
> >
> > La directory `test` c
On Wed, Aug 05 2015, Manlio Perillo wrote:
> Oggi per la prima volta sto lavorando ad un progetto che contiene più di un
> package:
>
> pkg/
> foo/
> bar/
> test/
> foo/
> bar/
>
> La directory `test` contiene la test suite.
>
> Il problema è che quando eseguo i test
Potresti usare un'import relativo:
from .. import foo (se sei su python2 dovrai importare anche
absolute_import da future )
https://www.python.org/dev/peps/pep-0328/#guido-s-decision
Il giorno 5 agosto 2015 17:22, Manlio Perillo ha
scritto:
> Oggi per la prima volta sto lavorando ad un progett
Oggi per la prima volta sto lavorando ad un progetto che contiene più di un
package:
pkg/
foo/
bar/
test/
foo/
bar/
La directory `test` contiene la test suite.
Il problema è che quando eseguo i test con nosetests, l'istruzione
`import foo` importa il package da `pkg/t