Repository: modin-project/modin

Issue:
conftest.PatchedEnv doesn't implement pop() quite right, leading to TypeErrors in some edge cases
### System information
- Fedora 33
- **Modin version** (`modin.__version__`): 0.8.2.1+40.g26c21e9
- **Python version**: 3.8

### Describe the problem
In modin/conftest.py, `PatchedEnv.pop` doesn't support the optional second argument that normal dictionaries do, resulting in:

```
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/_pytest/main.py", line 257, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/_pytest/main.py", line 313, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/pytest_cov/plugin.py", line 262, in pytest_runtestloop
INTERNALERROR>     yield
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/pytest_cov/engine.py", line 44, in ensure_topdir_wrapper
INTERNALERROR>     return meth(self, *args, **kwargs)
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/pytest_cov/engine.py", line 228, in finish
INTERNALERROR>     self.unset_env()
INTERNALERROR>   File "/home/itamarst/Devel/modin/venv/lib64/python3.8/site-packages/pytest_cov/engine.py", line 109, in unset_env
INTERNALERROR>     os.environ.pop('COV_CORE_SOURCE', None)
INTERNALERROR> TypeError: pop() takes 2 positional arguments but 3 were given
```

With a normal Python dictionary, `os.enviorn.pop("WHATEVER", None)` returns `None` if `WHATEVER` isn't set.


Discussion:
@itamarst thanks for posting!

Resolving patch:
diff --git a/modin/conftest.py b/modin/conftest.py
--- a/modin/conftest.py
+++ b/modin/conftest.py
@@ -155,13 +155,13 @@ def __delitem__(self, name):
             self.__check_var(name)
             del orig_env[name]
 
-        def pop(self, name):
+        def pop(self, name, default=object()):
             self.__check_var(name)
-            return orig_env.pop(name)
+            return orig_env.pop(name, default)
 
-        def get(self, name, defvalue=None):
+        def get(self, name, default=None):
             self.__check_var(name)
-            return orig_env.get(name, defvalue)
+            return orig_env.get(name, default)
 
         def __contains__(self, name):
             self.__check_var(name)


Test patch: