Search code examples
pythoninstallationtwistedtrial

How do I run a twisted trial in Windows?


I'm new to Python, Twisted, and Trial... and for Windows users the setup process isn't very clear. Right now, I have Python 2.7 installed, along with Twisted. From the Python GUI, I can run the reactor, so I'm convinced things are set up OK. But I can't figure out how to run trial from the command line to run my unit tests. I don't see an executable anywhere for it.

This post gives me a hint that a patch needs to be installed in the twisted setup.py... Although I don't know where that file is located. The comments mention I should just use the Twisted cmd shell, which again, I don't know where it is at.

Any pointers would be appreciated.


Solution

  • There's nothing terribly special about running trial on Windows. Run it like any Python script:

    C:\Python27\python.exe C:\Python27\Scripts\trial.py [additional arguments]
    

    Or if you have .py associated with a Python interpreter already:

    C:\Python27\Scripts\trial.py [additional arguments]
    

    Or if you have the Python Scripts folder in your %PATH% already:

    trial.py [additional arguments]
    

    Or if you have that folder on your %PATH% and '.py' is in your %PATHEXT% already:

    trial [additional arguments]