Skip to content

Commit 47b55ce

Browse files
authored
Fixing failing tests for changes in Rich markdown rendering (#2172)
* Fixing failing tests for changes in Rich markdown rendering * Fix format of dependencies for test_context_formatting * Update table formatting * Fix formatting * Adjust spacing and formatting * run lint
1 parent cc4acd6 commit 47b55ce

File tree

3 files changed

+22
-22
lines changed

3 files changed

+22
-22
lines changed

tests/cli/dep/show/test_table.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_project_only(hatch, helpers, temp_dir, config_file):
6969
assert result.exit_code == 0, result.output
7070
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
7171
"""
72-
Project
72+
Project
7373
+-------------+
7474
| Name |
7575
+=============+
@@ -103,7 +103,7 @@ def test_environment_only(hatch, helpers, temp_dir, config_file):
103103
assert result.exit_code == 0, result.output
104104
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
105105
"""
106-
Env: default
106+
Env: default
107107
+-------------+
108108
| Name |
109109
+=============+
@@ -140,13 +140,13 @@ def test_default_both(hatch, helpers, temp_dir, config_file):
140140
assert result.exit_code == 0, result.output
141141
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
142142
"""
143-
Project
143+
Project
144144
+-------------+
145145
| Name |
146146
+=============+
147147
| foo-bar-baz |
148148
+-------------+
149-
Env: default
149+
Env: default
150150
+-------------+
151151
| Name |
152152
+=============+
@@ -196,15 +196,15 @@ def test_optional_columns(hatch, helpers, temp_dir, config_file):
196196
assert result.exit_code == 0, result.output
197197
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
198198
"""
199-
Project
199+
Project
200200
+-----------------+----------+------------------------+------------+
201201
| Name | Versions | Markers | Features |
202202
+=================+==========+========================+============+
203203
| bar-baz | >=1.2rc5 | | eddsa, tls |
204204
| foo | | python_version < '3.8' | |
205205
| python-dateutil | | | |
206206
+-----------------+----------+------------------------+------------+
207-
Env: default
207+
Env: default
208208
+---------+----------------------------------------+----------+------------------------+------------+
209209
| Name | URL | Versions | Markers | Features |
210210
+=========+========================================+==========+========================+============+
@@ -252,7 +252,7 @@ def test_plugin_dependencies_unmet(hatch, helpers, temp_dir, config_file, mock_p
252252
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
253253
"""
254254
Syncing environment plugin requirements
255-
Project
255+
Project
256256
+-------------+
257257
| Name |
258258
+=============+

tests/cli/env/test_show.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def test_default(hatch, helpers, temp_dir, config_file):
3636
assert result.exit_code == 0, result.output
3737
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
3838
"""
39-
Standalone
39+
Standalone
4040
+---------+---------+
4141
| Name | Type |
4242
+=========+=========+
@@ -107,7 +107,7 @@ def test_single_only(hatch, helpers, temp_dir, config_file):
107107
assert result.exit_code == 0, result.output
108108
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
109109
"""
110-
Standalone
110+
Standalone
111111
+---------+---------+
112112
| Name | Type |
113113
+=========+=========+
@@ -145,13 +145,13 @@ def test_single_and_matrix(hatch, helpers, temp_dir, config_file):
145145
assert result.exit_code == 0, result.output
146146
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
147147
"""
148-
Standalone
148+
Standalone
149149
+---------+---------+
150150
| Name | Type |
151151
+=========+=========+
152152
| default | virtual |
153153
+---------+---------+
154-
Matrices
154+
Matrices
155155
+------+---------+----------------+
156156
| Name | Type | Envs |
157157
+======+=========+================+
@@ -190,7 +190,7 @@ def test_default_matrix_only(hatch, helpers, temp_dir, config_file):
190190
assert result.exit_code == 0, result.output
191191
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
192192
"""
193-
Matrices
193+
Matrices
194194
+---------+---------+------------+
195195
| Name | Type | Envs |
196196
+=========+=========+============+
@@ -231,13 +231,13 @@ def test_all_matrix_types_with_single(hatch, helpers, temp_dir, config_file):
231231
assert result.exit_code == 0, result.output
232232
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
233233
"""
234-
Standalone
234+
Standalone
235235
+------+---------+
236236
| Name | Type |
237237
+======+=========+
238238
| bar | virtual |
239239
+------+---------+
240-
Matrices
240+
Matrices
241241
+---------+---------+----------------+
242242
| Name | Type | Envs |
243243
+=========+=========+================+
@@ -280,7 +280,7 @@ def test_specific(hatch, helpers, temp_dir, config_file):
280280
assert result.exit_code == 0, result.output
281281
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
282282
"""
283-
Standalone
283+
Standalone
284284
+------+---------+
285285
| Name | Type |
286286
+======+=========+
@@ -377,7 +377,7 @@ def test_optional_columns(hatch, helpers, temp_dir, config_file):
377377
assert result.exit_code == 0, result.output
378378
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
379379
"""
380-
Standalone
380+
Standalone
381381
+------+---------+----------+-----------------------------+-----------------------+---------+----------------------------------------------------------------------------------------------------------+
382382
| Name | Type | Features | Dependencies | Environment variables | Scripts | Description |
383383
+======+=========+==========+=============================+=======================+=========+==========================================================================================================+
@@ -387,7 +387,7 @@ def test_optional_columns(hatch, helpers, temp_dir, config_file):
387387
| | | | | | | fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia |
388388
| | | | | | | deserunt mollit anim id est laborum. |
389389
+------+---------+----------+-----------------------------+-----------------------+---------+----------------------------------------------------------------------------------------------------------+
390-
Matrices
390+
Matrices
391391
+---------+---------+------------+----------+-----------------------------+-----------------------+---------+------------------------------------------------------------------------------------------+
392392
| Name | Type | Envs | Features | Dependencies | Environment variables | Scripts | Description |
393393
+=========+=========+============+==========+=============================+=======================+=========+==========================================================================================+
@@ -425,7 +425,7 @@ def test_context_formatting(hatch, helpers, temp_dir, config_file):
425425
"default",
426426
{
427427
"matrix": [{"version": ["9000", "3.14"], "py": ["39", "310"]}],
428-
"dependencies": ["foo @ {root:uri}/../foo"],
428+
"dependencies": ["foo@ {root:uri}/../foo"],
429429
},
430430
)
431431

@@ -445,13 +445,13 @@ def test_context_formatting(hatch, helpers, temp_dir, config_file):
445445
assert result.exit_code == 0, result.output
446446
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
447447
"""
448-
Standalone
448+
Standalone
449449
+------+---------+--------------+-----------------------+
450450
| Name | Type | Dependencies | Environment variables |
451451
+======+=========+==============+=======================+
452452
| foo | virtual | pydantic | BAR=FOO_BAR |
453453
+------+---------+--------------+-----------------------+
454-
Matrices
454+
Matrices
455455
+---------+---------+------------+-------------------------+
456456
| Name | Type | Envs | Dependencies |
457457
+=========+=========+============+=========================+
@@ -496,7 +496,7 @@ def test_plugin_dependencies_unmet(hatch, helpers, temp_dir, config_file, mock_p
496496
assert helpers.remove_trailing_spaces(result.output) == helpers.dedent(
497497
"""
498498
Syncing environment plugin requirements
499-
Standalone
499+
Standalone
500500
+---------+---------+
501501
| Name | Type |
502502
+=========+=========+

tests/cli/python/test_show.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def render_table(title, rows):
1616
table.add_row(*row)
1717

1818
with console.capture() as capture:
19-
console.print(table)
19+
console.print(table, overflow="ignore", no_wrap=True, crop=False)
2020

2121
return capture.get()
2222

0 commit comments

Comments
 (0)