How to add -m unittest to Python runner TeamCity built configuration

Completed

Hey everyone, 

I am gonna try to describe to the best of my ability of what I need help with. I am not very good at writing requests lol.

So I just got TeamCity to work and I want to run a basic unit test on the server. As you may know, to run a unit test in python you need to execute the test file with "python3 -m unittest example.py". I've been searching for 2 hours now in the built configurations and I still don't know how to set it up. I thought that I could simply add "-m unittest testfile.py" in the command line arguments but when I look at the log it displays python3 example.py "-m unittest testfile.py" which makes sense to me now (dont judge). 

Thanks. 

1 comment
Comment actions Permalink

Hi,

 

If you need to run custom commands, you can use the command line runner rather than the specific build runners. Custom build runners have a limited subset of options typically but present them in an easier to use approach. Furthermore, the python build runner is not developed by the teamcity team, but by a separate developer on his own, so we cannot really provide support for its specifics as it's not under our control.

0

Please sign in to leave a comment.