Re: Unit-testing in same file

new topic     » goto parent     » topic index » view thread      » older message » newer message

It is possible to test whether your file is executed directly instead of imported by checking the result of the function command_line().

The second element of the sequence returned by this function is the file that was executed.
If the second element of the result ends with your file name it was executed directly, not imported.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu