Repository: conda/conda

Issue:
nomkl tests running on Windows fail
Appears some `nomkl` feature tests are being run on Windows and [failing on CI]( https://ci.appveyor.com/project/ContinuumAnalyticsFOSS/conda/builds/20408292/job/q40u301c397wpyji?fullLog=true#L1181 ). IIUC `nomkl` does not exist on Windows. So this is as expected. Should these tests be marked as known fails, skipped, or similar?
Conda Init (v4.6.0b1 ) --system cmd.exe chokes
```
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "c:\users\wani\downloads\repos\conda\conda\exceptions.py", line 1001, in __call__
        return func(*args, **kwargs)
      File "c:\users\wani\downloads\repos\conda\conda\cli\main.py", line 84, in _main
        exit_code = do_call(args, p)
      File "c:\users\wani\downloads\repos\conda\conda\cli\conda_argparse.py", line 81, in do_call
        exit_code = getattr(module, func_name)(args, parser)
      File "c:\users\wani\downloads\repos\conda\conda\cli\main_init.py", line 52, in execute
        anaconda_prompt)
      File "c:\users\wani\downloads\repos\conda\conda\core\initialize.py", line 106, in initialize
        run_plan(plan2)
      File "c:\users\wani\downloads\repos\conda\conda\core\initialize.py", line 552, in run_plan
        result = globals()[step['function']](*step.get('args', ()), **step.get('kwargs', {}))
      File "c:\users\wani\downloads\repos\conda\conda\core\initialize.py", line 1196, in init_long_path
        _write_windows_registry(target_path, "1", winreg.REG_DWORD)
      File "c:\users\wani\downloads\repos\conda\conda\core\initialize.py", line 1143, in _write_windows_registry
        winreg.SetValueEx(key, value_name, 0, value_type, value_value)
    ValueError: Could not convert the data to the specified type.

`$ C:\ProgramData\MinicondaX\Scripts\conda-script.py init --system cmd.exe`
```


Discussion:

Resolving patch:
diff --git a/conda/core/initialize.py b/conda/core/initialize.py
--- a/conda/core/initialize.py
+++ b/conda/core/initialize.py
@@ -1118,7 +1118,9 @@ def _read_windows_registry(target_path):  # pragma: no cover
 
     try:
         value_tuple = winreg.QueryValueEx(key, value_name)
-        value_value = value_tuple[0].strip()
+        value_value = value_tuple[0]
+        if isinstance(value_value, str):
+            value_value = value_value.strip()
         value_type = value_tuple[1]
         return value_value, value_type
     except Exception:
@@ -1187,13 +1189,13 @@ def init_long_path(target_path):
     # win10, build 14352 was the first preview release that supported this
     if int(win_ver) >= 10 and int(win_rev) >= 14352:
         prev_value, value_type = _read_windows_registry(target_path)
-        if prev_value != "1":
+        if str(prev_value) != "1":
             if context.verbosity:
                 print('\n')
                 print(target_path)
-                print(make_diff(prev_value, "1"))
+                print(make_diff(str(prev_value), '1'))
             if not context.dry_run:
-                _write_windows_registry(target_path, "1", winreg.REG_DWORD)
+                _write_windows_registry(target_path, 1, winreg.REG_DWORD)
             return Result.MODIFIED
         else:
             return Result.NO_CHANGE


Test patch:
diff --git a/tests/common/pkg_formats/test_python.py b/tests/common/pkg_formats/test_python.py
--- a/tests/common/pkg_formats/test_python.py
+++ b/tests/common/pkg_formats/test_python.py
@@ -398,7 +398,7 @@ def test_metadata():
 
 # Python Distributions
 # -----------------------------------------------------------------------------
-@pytest.mark.xfail(datetime.now() < datetime(2018, 12, 1),
+@pytest.mark.xfail(datetime.now() < datetime(2019, 1, 1),
                    reason="This test needs to be refactored for the case of raising a hard "
                                 "error when the anchor_file doesn't exist.",
                    strict=True)
diff --git a/tests/core/test_initialize.py b/tests/core/test_initialize.py
--- a/tests/core/test_initialize.py
+++ b/tests/core/test_initialize.py
@@ -826,7 +826,7 @@ def _read_windows_registry_mock(target_path):
 
     @pytest.mark.skipif(not on_win, reason="win-only test")
     def test_init_enable_long_path(self):
-        self.dummy_value = "0"
+        self.dummy_value = 0
 
         def _read_windows_registry_mock(target_path):
             return self.dummy_value, "REG_DWORD"
@@ -844,9 +844,9 @@ def _write_windows_registry_mock(target_path, value, dtype):
 
         try:
             target_path = r'HKEY_LOCAL_MACHINE\\SYSTEM\\CurrentControlSet\\Control\\FileSystem\\LongPathsEnabled'
-            assert initialize._read_windows_registry(target_path)[0] == "0"
+            assert initialize._read_windows_registry(target_path)[0] == 0
             initialize.init_long_path(target_path)
-            assert initialize._read_windows_registry(target_path)[0] == "1"
+            assert initialize._read_windows_registry(target_path)[0] == 1
         finally:
             initialize._read_windows_registry = orig_read_windows_registry
             initialize._write_windows_registry = orig_write_windows_registry
diff --git a/tests/test_create.py b/tests/test_create.py
--- a/tests/test_create.py
+++ b/tests/test_create.py
@@ -584,8 +584,13 @@ def test_strict_channel_priority(self):
         assert not stderr
         json_obj = json_loads(stdout)
         channel_groups = groupby("channel",json_obj["actions"]["LINK"])
+        channel_groups = sorted(list(channel_groups))
         # conda-forge should be the only channel in the solution on unix
-        assert list(channel_groups) == ["conda-forge"]
+        # fiona->gdal->libgdal->m2w64-xz brings in pkgs/msys2 on win
+        if on_win:
+            assert channel_groups == ["conda-forge", "pkgs/msys2"]
+        else:
+            assert channel_groups == ["conda-forge"]
 
     def test_strict_resolve_get_reduced_index(self):
         channels = (Channel("defaults"),)
@@ -925,8 +930,7 @@ def test_install_freeze_installed_flag(self):
                 run_command(Commands.INSTALL, prefix,
                             "conda-forge::tensorflow>=1.4 --dry-run --freeze-installed")
 
-    @pytest.mark.xfail(on_win and datetime.now() < datetime(2018, 11, 1),
-                       reason="need to talk with @msarahan about blas patches on Windows",
+    @pytest.mark.xfail(on_win, reason="nomkl not present on windows",
                        strict=True)
     def test_install_features(self):
         with make_temp_env("python=2 numpy=1.13 nomkl") as prefix:
diff --git a/tests/test_resolve.py b/tests/test_resolve.py
--- a/tests/test_resolve.py
+++ b/tests/test_resolve.py
@@ -1025,7 +1025,7 @@ def test_no_features():
     ]
 
 
-@pytest.mark.skipif(datetime.now() < datetime(2018, 12, 1), reason="bogus test; talk with @mcg1969")
+@pytest.mark.skipif(datetime.now() < datetime(2019, 1, 1), reason="bogus test; talk with @mcg1969")
 def test_multiple_solution():
     assert False
 #    index2 = index.copy()