Merge lp:~verterok/ols-tests/bionic-loader-tests into lp:ols-tests

Proposed by Guillermo Gonzalez
Status: Merged
Approved by: Guillermo Gonzalez
Approved revision: 225
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: lp:~verterok/ols-tests/bionic-loader-tests
Merge into: lp:ols-tests
Diff against target: 101 lines (+54/-3)
1 file modified
olstests/tests/test_loaders.py (+54/-3)
To merge this branch: bzr merge lp:~verterok/ols-tests/bionic-loader-tests
Reviewer Review Type Date Requested Status
Daniel Manrique (community) Approve
Review via email: mp+422902@code.launchpad.net

Commit message

fix loader tests for python >= 3.6

Description of the change

To post a comment you must log in.
Revision history for this message
Daniel Manrique (roadmr) wrote :

+1 foo

review: Approve
Revision history for this message
Otto Co-Pilot (otto-copilot) wrote :

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'olstests/tests/test_loaders.py'
2--- olstests/tests/test_loaders.py 2016-02-08 17:54:01 +0000
3+++ olstests/tests/test_loaders.py 2022-05-18 19:02:10 +0000
4@@ -69,6 +69,29 @@
5 ImportError: No module named foo.bar.baz
6 ''',
7 unicode(cm.exception))
8+ elif sys.version_info.major == 3 and sys.version_info.minor < 6:
9+ assertions.assertMultiLineAlmostEqual(self, '''\
10+Failed to import foo.bar.baz at ./foo.bar/baz:
11+Traceback (most recent call last):
12+ File "...", line ..., in importFromPath
13+ return importlib.import_module(mod_name)
14+ File "...", line ..., in import_module
15+ ...
16+ ...
17+ ...
18+ ...
19+ ...
20+ ...
21+ ...
22+ ...
23+ ...
24+ ...
25+ ...
26+ ...
27+ImportError: No module named 'foo'
28+''',
29+ str(cm.exception))
30+
31 else:
32 assertions.assertMultiLineAlmostEqual(self, '''\
33 Failed to import foo.bar.baz at ./foo.bar/baz:
34@@ -88,7 +111,7 @@
35 ...
36 ...
37 ...
38-ImportError: No module named 'foo'
39+ModuleNotFoundError: No module named 'foo'
40 ''',
41 str(cm.exception))
42
43@@ -114,6 +137,20 @@
44 ImportError: No module named foo
45 ''',
46 unicode(cm.exception))
47+ elif sys.version_info.major == 3 and sys.version_info.minor < 6:
48+ assertions.assertMultiLineAlmostEqual(self, '''\
49+Failed to import foo at ./foo:
50+Traceback (most recent call last):
51+ File "...", line ..., in importFromPath
52+ return importlib.import_module(mod_name)
53+ File "...", line ..., in import_module
54+ ...
55+ ...
56+ ...
57+ ...
58+ImportError: No module named 'foo'
59+''',
60+ unicode(cm.exception))
61 else:
62 assertions.assertMultiLineAlmostEqual(self, '''\
63 Failed to import foo at ./foo:
64@@ -125,7 +162,7 @@
65 ...
66 ...
67 ...
68-ImportError: No module named 'foo'
69+ModuleNotFoundError: No module named 'foo'
70 ''',
71 unicode(cm.exception))
72
73@@ -143,6 +180,20 @@
74 ImportError: No module named foo
75 ''',
76 unicode(cm.exception))
77+ elif sys.version_info.major == 3 and sys.version_info.minor < 6:
78+ assertions.assertMultiLineAlmostEqual(self, '''\
79+Failed to import foo at ./foo.py:
80+Traceback (most recent call last):
81+ File "...", line ..., in importFromPath
82+ return importlib.import_module(mod_name)
83+ File "...", line ..., in import_module
84+ ...
85+ ...
86+ ...
87+ ...
88+ImportError: No module named 'foo'
89+''',
90+ unicode(cm.exception))
91 else:
92 assertions.assertMultiLineAlmostEqual(self, '''\
93 Failed to import foo at ./foo.py:
94@@ -154,7 +205,7 @@
95 ...
96 ...
97 ...
98-ImportError: No module named 'foo'
99+ModuleNotFoundError: No module named 'foo'
100 ''',
101 unicode(cm.exception))
102

Subscribers

People subscribed via source and target branches