Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
python-poetry
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
python-poetry
Commits
0b1d869a
Unverified
Commit
0b1d869a
authored
Jan 30, 2023
by
Charles Brunet
Committed by
GitHub
Jan 30, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make test locale independent (#7411)
parent
68770a67
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
tests/console/commands/test_run.py
+9
-12
No files found.
tests/console/commands/test_run.py
View file @
0b1d869a
...
...
@@ -65,26 +65,23 @@ def test_run_keeps_options_passed_before_command(
def
test_run_has_helpful_error_when_command_not_found
(
app_tester
:
ApplicationTester
,
env
:
MockEnv
,
capfd
:
pytest
.
CaptureFixture
[
str
]
):
nonexistent_command
=
"nonexistent-command"
env
.
_execute
=
True
app_tester
.
execute
(
"run nonexistent-command
"
)
app_tester
.
execute
(
f
"run {nonexistent_command}
"
)
assert
env
.
executed
==
[[
"nonexistent-command"
]]
assert
env
.
executed
==
[[
nonexistent_command
]]
assert
app_tester
.
status_code
==
1
if
WINDOWS
:
# On Windows we use a shell to run commands which provides its own error
# message when a command is not found that is not captured by the
# ApplicationTester but is captured by pytest, and we can access it via capfd.
# The expected string in this assertion assumes Command Prompt (cmd.exe) is the
# shell used.
assert
capfd
.
readouterr
()
.
err
.
splitlines
()
==
[
(
"'nonexistent-command' is not recognized as an internal or external"
" command,"
),
"operable program or batch file."
,
]
# The exact error message depends on the system language. Thus, we check only
# for the name of the command.
assert
nonexistent_command
in
capfd
.
readouterr
()
.
err
else
:
assert
app_tester
.
io
.
fetch_error
()
==
"Command not found: nonexistent-command
\n
"
assert
(
app_tester
.
io
.
fetch_error
()
==
f
"Command not found: {nonexistent_command}
\n
"
)
@pytest.mark.skipif
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment