Opened 8 years ago

Closed 8 years ago

#2192 enhancement closed wontfix (wontfix)

add __main__ func to trial.py allows trial to be executed under the pydev debugger

Reported by: scmikes Owned by:
Priority: normal Milestone:
Component: trial Keywords: trial debug eclipse pydef
Cc: Branch:
Author: Launchpad Bug:

Description (last modified by exarkun)

This is a very simple enhancement, adding the following to the end of trial.py allows trial to be easily executed under the pydev eclipse debugger. This would probably simplify debug execution under other IDE's as well.

I do not know of any downsides (although there may be downsided that I am not aware of)

Thanks,
Mike

if __name__ == "__main__":
    run()   

Attachments (1)

trial.py (13.1 KB) - added by scmikes 8 years ago.

Download all attachments as: .zip

Change History (8)

Changed 8 years ago by scmikes

comment:1 Changed 8 years ago by exarkun

  • Description modified (diff)

(Quoting code in description)

comment:2 Changed 8 years ago by exarkun

Why can't the current bin/trial be run with pydev?

comment:3 Changed 8 years ago by glyph

Some downsides are covered here:

http://glyf.livejournal.com/60326.html

When I personally tried to run trial with pydev, I couldn't figure out how to tell it to run something that didn't end in ".py" and I wrote my own script to run it. However, at that time I also had to include the test name in that script, since I couldn't specify any command-line arguments. I have to assume the situation has improved at least a little since then.

Interesting question though; assuming there is a legitimate reason, what does the unit test for this patch look like? or indeed, for any mainpoints?

comment:4 Changed 8 years ago by exarkun

  • Milestone Twisted-2.5 deleted

Also I can't think of any particular reason this should be part of the 2.5 milestone.

comment:5 follow-up: Changed 8 years ago by scmikes

exarkun and glyph: If there is an risk/downside to this. I have no problem just mofifying a local copy of trial.

The convience is not worth any risk.

Feel free to drop this if you like,
Mike

comment:6 in reply to: ↑ 5 Changed 8 years ago by scmikes

  • Resolution set to wontfix
  • Status changed from new to closed

Replying to scmikes:

exarkun and glyph: If there is an risk/downside to this. I have no problem just mofifying a local copy of trial.

The convience is not worth any risk.

Feel free to drop this if you like,
Mike

The workaround for pydev is to write a wrapper python module to call trial.

This requires no changes to trial.

I am marking this as closed.

comment:7 Changed 3 years ago by <automation>

  • Owner jml deleted
Note: See TracTickets for help on using tickets.