Re: am i choosing write way of producing stuf?

@4
You can put _test at the end too, so you can navigate through files and functions more easily.

Admittedly, I always name my functions starting with test_, but that's because I'm a creature of habit mor than anything else.

@1
If you're asking about the canonical way of doing stuff, then what the others have said is right. Your file structure should look something like this:

module_name
    __init__.py
    folder 1
        __init__.py
        file_1.py
        file_2.py
        ...
    file_1.py
    file_2.py
    ...
tests
    __init__.py
    first_test.py
    second_test.py
    ...

Of course, the files names don't matter, apart from the __init__.py, which Python likes to have in your module directories, especially the tests directory, where py.test looks for tests.

Again, a +1 from me for py.test. It's what I use, and it gives you lots of nice stuff like:

py.test --pdb

Drops you into the Python debugger if something fails so you can test code with a REPL.



-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector
  • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : TextAdventurer via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : TextAdventurer via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : Dragonlee via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : NicklasMCHD via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : camlorn via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : bhanuponguru via Audiogames-reflector
    • ... AudioGames . net Forum — Developers room : chrisnorman7 via Audiogames-reflector

Reply via email to