aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/python/traitlets/py3/patches/01-fix-tests.patch
blob: a4b6de274d4931aece141b095fd219d5a8453332 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
--- contrib/python/traitlets/py3/traitlets/config/tests/test_configurable.py	(index)
+++ contrib/python/traitlets/py3/traitlets/config/tests/test_configurable.py	(working tree)
@@ -22,7 +22,7 @@ from traitlets.traitlets import (
 
 from traitlets.config.loader import Config
 
-from ...tests._warnings import expected_warnings
+from traitlets.tests._warnings import expected_warnings
 
 class MyConfigurable(Configurable):
     a = Integer(1, help="The integer a.").tag(config=True)
--- contrib/python/traitlets/py3/traitlets/config/tests/test_application.py	(index)
+++ contrib/python/traitlets/py3/traitlets/config/tests/test_application.py	(working tree)
@@ -629,6 +629,8 @@ class TestApplication(TestCase):
             self.assertEqual(app.running, False)
 
 
+
+@mark.skip
 def test_cli_multi_scalar(caplog):
     class App(Application):
         aliases = {"opt": "App.opt"}
@@ -648,7 +650,7 @@ def test_cli_multi_scalar(caplog):
 
 class Root(Application):
     subcommands = {
-        'sub1': ('traitlets.config.tests.test_application.Sub1', 'import string'),
+        'sub1': ('__tests__.config.tests.test_application.Sub1', 'import string'),
     }
 
 
--- contrib/python/traitlets/py3/traitlets/tests/test_traitlets.py	(index)
+++ contrib/python/traitlets/py3/traitlets/tests/test_traitlets.py	(working tree)
@@ -13,7 +13,7 @@ from unittest import TestCase
 
 import pytest
 
-from ._warnings import expected_warnings
+from traitlets.tests._warnings import expected_warnings
 from traitlets import (
     HasTraits,
     MetaHasTraits,
--- contrib/python/traitlets/py3/traitlets/utils/tests/test_bunch.py	(index)
+++ contrib/python/traitlets/py3/traitlets/utils/tests/test_bunch.py	(working tree)
@@ -1,4 +1,4 @@
-from ..bunch import Bunch
+from traitlets.utils.bunch import Bunch
 
 def test_bunch():
     b = Bunch(x=5, y=10)
--- contrib/python/traitlets/py3/traitlets/utils/tests/test_decorators.py	(index)
+++ contrib/python/traitlets/py3/traitlets/utils/tests/test_decorators.py	(working tree)
@@ -2,9 +2,9 @@ from unittest import TestCase
 
 from inspect import Signature, Parameter, signature
 
-from ...traitlets import HasTraits, Int, Unicode
+from traitlets.traitlets import HasTraits, Int, Unicode
 
-from ..decorators import signature_has_traits
+from traitlets.utils.decorators import signature_has_traits
 
 
 class TestExpandSignature(TestCase):
--- contrib/python/traitlets/py3/traitlets/utils/tests/test_importstring.py	(index)
+++ contrib/python/traitlets/py3/traitlets/utils/tests/test_importstring.py	(working tree)
@@ -8,7 +8,7 @@
 import os
 from unittest import TestCase
 
-from ..importstring import import_item
+from traitlets.utils.importstring import import_item
 
 
 class TestImportItem(TestCase):
--- contrib/python/traitlets/py3/traitlets/tests/utils.py	(index)
+++ contrib/python/traitlets/py3/traitlets/tests/utils.py	(working tree)
@@ -1,10 +1,13 @@
 from subprocess import Popen, PIPE
 import sys
+import os
 
 
 def get_output_error_code(cmd):
     """Get stdout, stderr, and exit code from running a command"""
-    p = Popen(cmd, stdout=PIPE, stderr=PIPE)
+    env = os.environ.copy()
+    env['Y_PYTHON_ENTRY_POINT'] = ':main'
+    p = Popen(cmd, stdout=PIPE, stderr=PIPE, env=env)
     out, err = p.communicate()
     out = out.decode('utf8', 'replace')
     err = err.decode('utf8', 'replace')