$OpenBSD: patch-jupyter_core_tests_test_command_py,v 1.3 2020/02/16 05:20:29 bket Exp $
Index: jupyter_core/tests/test_command.py
--- jupyter_core/tests/test_command.py.orig
+++ jupyter_core/tests/test_command.py
@@ -99,20 +99,24 @@ def test_subcommand_not_found():
 
 @patch.object(sys, 'argv', [__file__] + sys.argv[1:])
 def test_subcommand_list(tmpdir):
+    if sys.version_info.major == 3:
+        cmd_sufx = '-3'
+    else:
+        cmd_sufx = ''
     a = tmpdir.mkdir("a")
     for cmd in ('jupyter-foo-bar',
                 'jupyter-xyz',
                 'jupyter-babel-fish'):
-        a.join(cmd).write('')
+        a.join(cmd + cmd_sufx).write('')
     b = tmpdir.mkdir("b")
     for cmd in ('jupyter-foo',
                 'jupyterstuff',
                 'jupyter-yo-eyropa-ganymyde-callysto'):
-        b.join(cmd).write('')
+        b.join(cmd + cmd_sufx).write('')
     c = tmpdir.mkdir("c")
     for cmd in ('jupyter-baz',
                 'jupyter-bop'):
-        c.join(cmd).write('')
+        b.join(cmd + cmd_sufx).write('')
     
     path = os.pathsep.join(map(str, [a, b]))
 
@@ -132,13 +136,17 @@ def test_subcommand_list(tmpdir):
             ]
 
 def test_not_on_path(tmpdir):
+    if sys.version_info.major == 3:
+        cmd_sufx = '-3'
+    else:
+        cmd_sufx = ''
     a = tmpdir.mkdir("a")
     jupyter = a.join('jupyter')
     jupyter.write(
         'from jupyter_core import command; command.main()'
     )
     jupyter.chmod(0o700)
-    witness = a.join('jupyter-witness')
+    witness = a.join('jupyter-witness' + cmd_sufx)
     witness_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS ME")')
     write_executable(witness, witness_src)
 
@@ -148,23 +156,27 @@ def test_not_on_path(tmpdir):
     if sys.platform == 'win32':
         env[str('PATHEXT')] = '.EXE'
     # This won't work on windows unless
-    out = check_output([sys.executable, str(jupyter), 'witness'], env=env)
+    out = check_output([sys.executable, str(jupyter), 'witness' + cmd_sufx], env=env)
     assert b'WITNESS' in out
 
 
 def test_path_priority(tmpdir):
+    if sys.version_info.major == 3:
+        cmd_sufx = '-3'
+    else:
+        cmd_sufx = ''
     a = tmpdir.mkdir("a")
     jupyter = a.join('jupyter')
     jupyter.write(
         'from jupyter_core import command; command.main()'
     )
     jupyter.chmod(0o700)
-    witness_a = a.join('jupyter-witness')
+    witness_a = a.join('jupyter-witness' + cmd_sufx)
     witness_a_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS A")')
     write_executable(witness_a, witness_a_src)
 
     b = tmpdir.mkdir("b")
-    witness_b = b.join('jupyter-witness')
+    witness_b = b.join('jupyter-witness' + cmd_sufx)
     witness_b_src = '#!%s\n%s\n' % (sys.executable, 'print("WITNESS B")')
     write_executable(witness_b, witness_b_src)
 
@@ -173,5 +185,5 @@ def test_path_priority(tmpdir):
         env[str('SYSTEMROOT')] = os.environ['SYSTEMROOT']
     if sys.platform == 'win32':
         env[str('PATHEXT')] = '.EXE'
-    out = check_output([sys.executable, str(jupyter), 'witness'], env=env)
+    out = check_output([sys.executable, str(jupyter), 'witness' + cmd_sufx], env=env)
     assert b'WITNESS A' in out
