(monkeypatch)
| 70 | |
| 71 | @pytest.fixture |
| 72 | def test_apps(monkeypatch): |
| 73 | monkeypatch.syspath_prepend(os.path.join(os.path.dirname(__file__), "test_apps")) |
| 74 | original_modules = set(sys.modules.keys()) |
| 75 | |
| 76 | yield |
| 77 | |
| 78 | # Remove any imports cached during the test. Otherwise "import app" |
| 79 | # will work in the next test even though it's no longer on the path. |
| 80 | for key in sys.modules.keys() - original_modules: |
| 81 | sys.modules.pop(key) |
| 82 | |
| 83 | |
| 84 | @pytest.fixture(autouse=True) |