File tree Expand file tree Collapse file tree 3 files changed +14
-24
lines changed Expand file tree Collapse file tree 3 files changed +14
-24
lines changed Load Diff Large diffs are not rendered by default.
Original file line number Diff line number Diff line change 1
- import importlib
2
- import sys
3
-
4
-
5
- def import_fresh (modname : str ):
6
- """
7
- Imports or reloads the module from a fresh state.
8
- """
9
- to_drop = [m for m in sys .modules if m == modname or m .startswith (modname + "." )]
10
- for m in to_drop :
11
- sys .modules .pop (m )
12
- return importlib .import_module (modname )
1
+ from tests .helpers .fixtures import import_fresh
13
2
14
3
15
4
def test_env_vars (monkeypatch ):
Original file line number Diff line number Diff line change 1
- import importlib
2
- import sys
3
-
4
-
5
- def import_fresh (modname : str ):
6
- """
7
- Imports or reloads the module from a fresh state.
8
- """
9
- to_drop = [m for m in sys .modules if m == modname or m .startswith (modname + "." )]
10
- for m in to_drop :
11
- sys .modules .pop (m )
12
- return importlib .import_module (modname )
1
+ from tests .helpers .fixtures import import_fresh
13
2
14
3
15
4
def test_env_vars (monkeypatch ):
You can’t perform that action at this time.
0 commit comments