tarpas / pytest-testmon

Selects tests affected by changed files. Executes the right tests first. Continuous test runner when used with pytest-watch.
https://testmon.org
MIT License
800 stars 54 forks source link

multiprocessing does not seem to be supported #192

Open janbernloehr opened 1 year ago

janbernloehr commented 1 year ago

Suppose I have the following code and tests

# mymodule.py
class MyClass:
    def foo(self):
        return "bar"

# test_mymodule.py
import multiprocessing

def __run_foo():
    from mymodule import MyClass
    c = MyClass()
    assert c.foo() == "bar"

def test_foo():
    process = multiprocessing.Process(target=__run_foo)
    process.start()
    process.join()
    assert process.exitcode == 0

After a first successful run of pytest --testmon test_mymodule.py, one can change the implementation of foo() without testmon noticing and no new runs are triggered.

When running pytest --cov manually, we get a trace image

tarpas commented 1 year ago

Correct. Users are welcome to react or comment to this issue so that I know how important it is.

FrankLeeeee commented 1 year ago

It will be great if multiprocessing can be supported. I think integrating with pytest-cov will be a good move.

janbernloehr commented 1 year ago

This is unfortunately still the case with testmon 2.0.9