b0g3r / perseus

WIP: snapshot management tool
MIT License
1 stars 1 forks source link

add runputest_inprocess with input support to PerseusTester #10

Closed Bobronium closed 3 years ago

Bobronium commented 3 years ago

As mentioned in https://github.com/b0g3r/perseus/issues/6#issuecomment-721915239, running subprocess for each test is really slow. Using inprocess pytest.main() is about five times faster on current tests and I finally got it to work 🎉:

$ pytest tests/test_snapshot.py --runpytest=subprocess:

======================== 2 passed, 2 warnings in 0.96s =========================

$ pytest tests/test_snapshot.py --runpytest=inprocess:

======================== 2 passed, 2 warnings in 0.18s =========================

Also moved PerseusTester to conftest.py

b0g3r commented 3 years ago

Thank you for your contribution, this speed-up is awesome! Of course, it looks ugly, but it's not your fault, this project promises to be hacky as hell 🌚