Dennis Dmitriev | 6f59add | 2016-10-18 13:45:27 +0300 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | import os |
| 4 | import sys |
| 5 | |
| 6 | import pytest |
| 7 | |
| 8 | import tcp_tests |
| 9 | |
| 10 | |
| 11 | def shell(): |
| 12 | if len(sys.argv) > 1: |
| 13 | # Run py.test for tcp_tests module folder with specified options |
| 14 | testpaths = os.path.dirname(tcp_tests.__file__) |
| 15 | opts = ' '.join(sys.argv[1:]) |
| 16 | addopts = '-vvv -s -p no:django -p no:ipdb --junit-xml=nosetests.xml' |
| 17 | return pytest.main('{testpaths} {addopts} {opts}'.format( |
| 18 | testpaths=testpaths, addopts=addopts, opts=opts)) |
| 19 | else: |
| 20 | return pytest.main('--help') |
| 21 | |
| 22 | |
| 23 | if __name__ == '__main__': |
| 24 | sys.exit(shell()) |