Skip to content

Commit f6d7a07

Browse files
committed
fix tests
1 parent d84ba2e commit f6d7a07

File tree

4 files changed

+7
-8
lines changed

4 files changed

+7
-8
lines changed

src/reactpy/testing/logs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,4 +175,4 @@ def _raise_log_message_error(
175175
conditions.append(f"exception type {error_type}")
176176
if match_error:
177177
conditions.append(f"error message pattern {match_error!r}")
178-
raise LogAssertionError(prefix + " " + " and ".join(conditions))
178+
raise LogAssertionError(f"{prefix} " + " and ".join(conditions))

src/reactpy/web/utils.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# nocov
2-
raise ImportError(
1+
raise ImportError( # nocov
32
"WARNING: reactpy.web.utils was not within the public API, and thus has been removed without notice."
43
)

tests/test_reactjs/test_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_resolve_module_exports_from_file_log_on_unknown_file_location(
6969
resolve_from_module_file(file, 2)
7070
assert len(caplog.records) == 1
7171
assert caplog.records[0].message.startswith(
72-
"Did not resolve exports for unknown file"
72+
"Did not resolve imports for unknown file"
7373
)
7474

7575

@@ -113,7 +113,7 @@ def test_resolve_module_exports_from_url_log_on_max_depth(caplog):
113113
def test_resolve_module_exports_from_url_log_on_bad_response(caplog):
114114
assert resolve_from_module_url("https://some.url", 1) == set()
115115
assert len(caplog.records) == 1
116-
assert caplog.records[0].message.startswith("Did not resolve exports for url")
116+
assert caplog.records[0].message.startswith("Did not resolve imports for url")
117117

118118

119119
@pytest.mark.parametrize(
@@ -147,7 +147,7 @@ def test_resolve_module_exports_from_source():
147147

148148

149149
def test_log_on_unknown_export_type():
150-
with assert_reactpy_did_log(match_message="Unknown export type "):
150+
with assert_reactpy_did_log(match_message="Found unknown export "):
151151
assert resolve_from_module_source(
152152
"export something unknown;", exclude_default=False
153153
) == (set(), set())

tests/test_web/test_module.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ def test_web_module_from_file_replace_existing(tmp_path):
165165
def test_module_missing_exports():
166166
module = JavaScriptModule("test", NAME_SOURCE, None, {"a", "b", "c"}, None, False)
167167

168-
with pytest.raises(ValueError, match=r"does not export 'x'"):
168+
with pytest.raises(ValueError, match=r"does not contain 'x'"):
169169
reactpy.reactjs.module_to_vdom(module, "x")
170170

171-
with pytest.raises(ValueError, match=r"does not export \['x', 'y'\]"):
171+
with pytest.raises(ValueError, match=r"does not contain \['x', 'y'\]"):
172172
reactpy.reactjs.module_to_vdom(module, ["x", "y"])
173173

174174

0 commit comments

Comments
 (0)