Skip to content

Commit 16c683d

Browse files
authored
Remove unused setns (#6804)
Last usage of it was removed in ba17363.
1 parent 2e48c32 commit 16c683d

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

src/_pytest/config/__init__.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1197,28 +1197,6 @@ def _warn_about_missing_assertion(mode):
11971197
)
11981198

11991199

1200-
def setns(obj, dic):
1201-
import pytest
1202-
1203-
for name, value in dic.items():
1204-
if isinstance(value, dict):
1205-
mod = getattr(obj, name, None)
1206-
if mod is None:
1207-
modname = "pytest.%s" % name
1208-
mod = types.ModuleType(modname)
1209-
sys.modules[modname] = mod
1210-
mod.__all__ = []
1211-
setattr(obj, name, mod)
1212-
obj.__all__.append(name)
1213-
setns(mod, value)
1214-
else:
1215-
setattr(obj, name, value)
1216-
obj.__all__.append(name)
1217-
# if obj != pytest:
1218-
# pytest.__all__.append(name)
1219-
setattr(pytest, name, value)
1220-
1221-
12221200
def create_terminal_writer(config: Config, *args, **kwargs) -> TerminalWriter:
12231201
"""Create a TerminalWriter instance configured according to the options
12241202
in the config object. Every code which requires a TerminalWriter object

0 commit comments

Comments
 (0)