| | 52 | |
| | 53 | Run just one test within a class: |
| | 54 | {{{ |
| | 55 | cd web2py |
| | 56 | python web2py.py -S eden -M -R applications/eden/modules/tests/suite.py -A -C mytestclass -M mytestmethod |
| | 57 | }}} |
| | 58 | |
| | 59 | === Command Line Arguments === |
| | 60 | |
| | 61 | A number of command line arguments have been added and more are being added so to get the latest list of available options use the --help switch, which you can quickly do as follows: |
| | 62 | {{{ |
| | 63 | python modules/tests/suite.py --help |
| | 64 | }}} |
| | 65 | |
| | 66 | Important options include: |
| | 67 | |
| | 68 | -C for class to run |
| | 69 | |
| | 70 | -M for test method within a class to run, when you use this option either use the -C option or provide the method in the format class.method |
| | 71 | |
| | 72 | If you have HTMLTestRunner installed then a nicely formatted html report will be generated, should you want to disable this then use the --nohtml option. The HTML report will be written to the path given by the switch --html_path which by default will the web2py folder since that is where the tests scripts are run from. The file name will have a timestamp appended to it, if you want you can have just a date by using the option html_name_date. |
| | 73 | |
| | 74 | The option --suite will run certain predefined tests. At the moment it supports '''smoke''', which runs a test to look for broken urls otherwise it will run all the tests. If a class or method are selected then this option is ignored. |