craigahobbs / unittest-parallel

Parallel unit test runner for Python with coverage support
MIT License
29 stars 5 forks source link

Parameterize the module I want to use to run tests #19

Closed felipearcaro closed 1 month ago

felipearcaro commented 4 months ago

I've been using your package and it works great, thank you for building it.

When I run python -m unittest, it executes the unittest module as a script - something like python unittest.py, which gives me some flexibility. For example, when I run Python unit tests inside of TeamCity, I can run python -m teamcity.unittestpy instead to use TeamCity's Python package (essentially a wrapper around unittest module) - that discovers and runs tests, and reports the results in a format that TeamCity can understand.

Do you think that could be added as a parameter, something like unittest-parallel -m teamcity.unittestpy? By quickly looking at your code and teamcity-messages's documentation, I believe that, in the scenario I described above, this line would run TeamcityTestRunner() instead.

I would be more than happy to work on it and put up a PR, let me know.

Note: This is probably an enhancement and not an issue.

craigahobbs commented 4 months ago

Sounds similar to #16.

felipearcaro commented 4 months ago

Oh right - I'll put up a PR for you to review. Thanks!

felipearcaro commented 3 months ago

Hey @craigahobbs - just created this PR. Thanks!

craigahobbs commented 2 months ago

Working in "feature/custom-runner":

https://github.com/craigahobbs/unittest-parallel/tree/feature/custom-runner

craigahobbs commented 1 month ago

Duplicate of #16