Commits

Ronny Pfannschmidt committed bbce811

add pytest hooks, dont add their entrypoints tho

gescript.pkgpacker/standalonetemplate are to be copyed to pylib for now

Comments (0)

Files changed (1)

genscript/pkgpacker.py

     return exe
 
 
+def pytest_addoption(parser):
+    group = parser.getgroup("debugconfig")
+    group.addoption("--genscript", action="store", default=None,
+        dest="genscript", metavar="path",
+        help="create standalone py.test script at given target path.")
+
+def pytest_cmdline_main(config):
+    genscript = config.getvalue("genscript")
+    if genscript:
+        script = generate_script(
+            'import py; py.test.cmdline.main()',
+            ['py', 'pytest'],
+        )
+
+        genscript = py.path.local(genscript)
+        genscript.write(script)
+        return 0